Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 66 additions & 96 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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\", \
Expand All @@ -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; \
Expand Down Expand Up @@ -206,79 +176,79 @@ 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 }}
RUN_TYPE: ${{ steps.set-run-type.outputs.result }}
# 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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
17 changes: 15 additions & 2 deletions tests/unit/pywbemlistener/cli_test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading