diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 964ab0fc..c2948fef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,21 +52,6 @@ jobs: \"python-version\": [ \"3.13.0\" ], \ \"package_level\": [ \"minimum\", \"latest\" ], \ \"include\": [ \ - { \ - \"os\": \"ubuntu-latest\", \ - \"python-version\": \"3.8\", \ - \"package_level\": \"minimum\" \ - }, \ - { \ - \"os\": \"ubuntu-latest\", \ - \"python-version\": \"3.8\", \ - \"package_level\": \"latest\" \ - }, \ - { \ - \"os\": \"ubuntu-latest\", \ - \"python-version\": \"3.10\", \ - \"package_level\": \"latest\" \ - }, \ { \ \"os\": \"macos-latest\", \ \"python-version\": \"3.8\", \ @@ -81,21 +66,6 @@ jobs: \"os\": \"macos-latest\", \ \"python-version\": \"3.13.0\", \ \"package_level\": \"minimum\" \ - }, \ - { \ - \"os\": \"windows-latest\", \ - \"python-version\": \"3.8\", \ - \"package_level\": \"latest\" \ - }, \ - { \ - \"os\": \"windows-latest\", \ - \"python-version\": \"3.12\", \ - \"package_level\": \"latest\" \ - }, \ - { \ - \"os\": \"windows-latest\", \ - \"python-version\": \"3.13.0\", \ - \"package_level\": \"latest\" \ } \ ] \ }" >> $GITHUB_OUTPUT; \ @@ -206,42 +176,42 @@ jobs: run: | echo "Package dependency tree of installed Python packages:" python -m pipdeptree --all - - name: Run check_reqs - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make check_reqs - - name: Run build - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make build - - name: Run builddoc - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make builddoc - - name: Run check - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make check - - name: Run ruff - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make ruff - - name: Run pylint - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make pylint + # - name: Run check_reqs + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make check_reqs + # - name: Run build + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make build + # - name: Run builddoc + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make builddoc + # - name: Run check + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make check + # - name: Run ruff + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make ruff + # - name: Run pylint + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make pylint - name: Run test env: PACKAGE_LEVEL: ${{ matrix.package_level }} @@ -249,36 +219,36 @@ jobs: # TESTCASES: test_class_cmds.py run: | make test - - name: Run end2end test with WBEM server Docker image - if: ${{ matrix.os == 'ubuntu-latest' }} - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - # Uses TEST_SERVER_IMAGE variable - run: | - make end2endtest - - name: Send coverage result to coveralls.io - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_PARALLEL: true - COVERALLS_FLAG_NAME: "${{ matrix.os }},${{ matrix.python-version }},${{ matrix.package_level }}" - COVERALLS_SERVICE_NAME: github - COVERALLS_SERVICE_JOB_ID: "${{ github.run_id }}" - COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}" - run: | - coveralls - - name: Run installtest - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make installtest - - name: Run safety - env: - PACKAGE_LEVEL: ${{ matrix.package_level }} - RUN_TYPE: ${{ steps.set-run-type.outputs.result }} - run: | - make safety + # - name: Run end2end test with WBEM server Docker image + # if: ${{ matrix.os == 'ubuntu-latest' }} + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # # Uses TEST_SERVER_IMAGE variable + # run: | + # make end2endtest + # - name: Send coverage result to coveralls.io + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # COVERALLS_PARALLEL: true + # COVERALLS_FLAG_NAME: "${{ matrix.os }},${{ matrix.python-version }},${{ matrix.package_level }}" + # COVERALLS_SERVICE_NAME: github + # COVERALLS_SERVICE_JOB_ID: "${{ github.run_id }}" + # COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}" + # run: | + # coveralls + # - name: Run installtest + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make installtest + # - name: Run safety + # env: + # PACKAGE_LEVEL: ${{ matrix.package_level }} + # RUN_TYPE: ${{ steps.set-run-type.outputs.result }} + # run: | + # make safety test_finish: needs: test diff --git a/Makefile b/Makefile index 9ad34060..9809bdbc 100644 --- a/Makefile +++ b/Makefile @@ -834,7 +834,7 @@ test: $(done_dir)/develop_$(pymn)_$(PACKAGE_LEVEL).done $(doc_utility_help_files ifeq ($(PLATFORM),Windows_native) cmd /c "set PYWBEMTOOLS_TERMWIDTH=$(pywbemtools_termwidth) & set PYWBEMCLI_ALT_HOME_DIR=$(PYWBEMCLI_ALT_HOME_DIR) & py.test --color=yes $(pytest_cov_opts) $(pytest_warning_opts) $(pytest_opts) tests/unit -s" else - PYWBEMTOOLS_TERMWIDTH=$(pywbemtools_termwidth) PYWBEMCLI_ALT_HOME_DIR=$(PYWBEMCLI_ALT_HOME_DIR) py.test --color=yes $(pytest_cov_opts) $(pytest_warning_opts) $(pytest_opts) tests/unit -s + PYWBEMTOOLS_TERMWIDTH=$(pywbemtools_termwidth) PYWBEMCLI_ALT_HOME_DIR=$(PYWBEMCLI_ALT_HOME_DIR) py.test --color=yes $(pytest_cov_opts) $(pytest_warning_opts) $(pytest_opts) tests/unit/pywbemlistener -s endif @echo "Makefile: Done running tests" diff --git a/tests/unit/pywbemlistener/cli_test_extensions.py b/tests/unit/pywbemlistener/cli_test_extensions.py index 9944e71c..0b0b1cbf 100644 --- a/tests/unit/pywbemlistener/cli_test_extensions.py +++ b/tests/unit/pywbemlistener/cli_test_extensions.py @@ -226,8 +226,21 @@ def check_output(cmd_args, situation, msg, verbose): try: out, err = p.communicate(timeout=30) except subprocess.TimeoutExpired: - p.kill() - p.wait() + print(f"{situation}: Warning: command '{cmd_args}' timed out, " + "killing it to clean up") + try: + print(f"Killing process of command '{cmd_args}'") + p.kill() + except Exception as exc: # pylint: disable=broad-exception-caught + print(f"Error: Killing process of command '{cmd_args}' failed " + f"with: {exc}") + try: + print(f"Waiting for killing of command '{cmd_args}' to be " + "complete") + p.wait() + except Exception as exc: # pylint: disable=broad-exception-caught + print(f"Error: Waiting for killing of command '{cmd_args}' " + f"failed with: {exc}") raise rc = p.poll() if rc: