Skip to content

Commit

Permalink
ci: attempt to divide up longtests
Browse files Browse the repository at this point in the history
The longtests are taking long enough to cause unexpected timeouts. This
attempts to break them up into several groups of tests to help make them
more manageable.

Signed-off-by: Terri Oda <terri.oda@intel.com>
  • Loading branch information
terriko committed Dec 16, 2024
1 parent 114ac56 commit d70d156
Showing 1 changed file with 21 additions and 39 deletions.
60 changes: 21 additions & 39 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,47 +198,13 @@ jobs:
)
)
runs-on: 'ubuntu-latest'
strategy:
matrix:
testgroup: ["sync", "async", "scanner", "language"]
timeout-minutes: 120
env:
LONG_TESTS: 1
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
access.redhat.com:443
api.codecov.io:443
api.github.com:443
archives.fedoraproject.org:443
azure.archive.ubuntu.com:80
cli.codecov.io:443
codecov.io:443
curl.se:443
epss.cyentia.com:443
esm.ubuntu.com:443
files.pythonhosted.org:443
ftp.fr.debian.org:80
github.com:443
gitlab.com:443
mirror.cveb.in:443
mirror.cveb.in:80
motd.ubuntu.com:443
nvd.nist.gov:443
osv-vulnerabilities.storage.googleapis.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
pypi.org:443
raw.githubusercontent.com:443
release-monitoring.org:443
rpmfind.net:443
security-tracker.debian.org:443
services.nvd.nist.gov:443
storage.googleapis.com:443
uploader.codecov.io:443
www.cisa.gov:443
www.sqlite.org:443
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
Expand Down Expand Up @@ -319,7 +285,7 @@ jobs:
NO_EXIT_CVE_NUM=1 python -m cve_bin_tool.cli test/assets/test-kerberos-5-1.15.1.out
cp -r ~/.cache/cve-bin-tool cache
- name: Run async tests
if: env.sbom != 'true'
if: env.sbom != 'true' && ${{ matrix.testgroup == 'async' }}
env:
LONG_TESTS: ${{ steps.git-diff.outputs.value }}
run: >
Expand All @@ -329,8 +295,24 @@ jobs:
--ignore=test/test_requirements.py
--ignore=test/test_html.py
--ignore=test/test_json.py
--ignore=test/test_scanner.py
--ignore=test/test_language_parser.py
- name: Run language parser tests
if: env.sbom != 'true' && ${{ matrix.testgroup == 'language' }}
env:
LONG_TESTS: ${{ steps.git-diff.outputs.value }}
run: >
pytest --cov --cov-append -n 4 -v --durations=50
test/test_language_parser.py
- name: Run scanner tests
if: env.sbom != 'true' && ${{ matrix.testgroup == 'scanner' }}
env:
LONG_TESTS: ${{ steps.git-diff.outputs.value }}
run: >
pytest --cov --cov-append -n 4 -v --durations=50
test/test_scanner.py
- name: Run synchronous tests
if: env.sbom != 'true'
if: env.sbom != 'true' && $${{ matrix.testgroup == 'sync` }}
env:
LONG_TESTS: ${{ steps.git-diff.outputs.value }}
run: >
Expand Down

0 comments on commit d70d156

Please sign in to comment.