Skip to content

Commit

Permalink
[WIP] 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmerchante committed Feb 27, 2025
1 parent c7f6f42 commit b17a45a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 43 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/e2e-tests.yml

This file was deleted.

35 changes: 34 additions & 1 deletion .github/workflows/unit-tests.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ on:
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:

sbom_metrics:
unit-tests:
strategy:
matrix:
python-version: [3.11, 3.12]
Expand Down Expand Up @@ -43,3 +44,35 @@ jobs:
- name: Tests
run: |
cd tests && poetry run python run_tests.py unit
e2e-tests:
strategy:
matrix:
python-version: [3.11, 3.12]

runs-on: ubuntu-latest
name: Python ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
poetry install --with dev -vvv
poetry run pip install -r requirements_dev.txt
- name: Lint with flake8
run: |
poetry run flake8
- name: Black check
run: |
poetry run black --check .
- name: Tests
run: |
cd tests && poetry run python run_tests.py end_to_end
10 changes: 5 additions & 5 deletions tests/end_to_end/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_metrics(self):
"--from-date=2000-01-01",
],
)
##self.assertEqual(result.exit_code, 0)
self.assertEqual(result.exit_code, 0)
# Check logs
self.assertIn("INFO:root:Parsing file ./data/archived_repos.spdx.xml", logger.output)
self.assertIn("INFO:root:Found 2 git repositories", logger.output)
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_from_date(self):
"--from-date=2017-01-01",
],
)
#self.assertEqual(result.exit_code, 0)
self.assertEqual(result.exit_code, 0)
# Check logs
self.assertIn("INFO:root:Parsing file ./data/archived_repos.spdx.xml", logger.output)
self.assertIn("INFO:root:Found 2 git repositories", logger.output)
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_to_date(self):
"--to-date=2017-01-01",
],
)
#self.assertEqual(result.exit_code, 0)
self.assertEqual(result.exit_code, 0)
# Check logs
self.assertIn("INFO:root:Parsing file ./data/archived_repos.spdx.xml", logger.output)
self.assertIn("INFO:root:Found 2 git repositories", logger.output)
Expand Down Expand Up @@ -260,7 +260,7 @@ def test_duplicate_repo(self):
"--from-date=2000-01-01",
],
)
#self.assertEqual(result.exit_code, 0)
self.assertEqual(result.exit_code, 0)
# Check logs
self.assertIn("INFO:root:Parsing file ./data/duplicate_repo.spdx.xml", logger.output)
self.assertIn("INFO:root:Found 1 git repositories", logger.output)
Expand Down Expand Up @@ -315,7 +315,7 @@ def test_non_git_repo(self):
"--from-date=2000-01-01",
],
)
#self.assertEqual(result.exit_code, 0)
self.assertEqual(result.exit_code, 0)
# Check logs
self.assertIn("INFO:root:Parsing file ./data/mercurial_repo.spdx.xml", logger.output)
self.assertIn("WARNING:root:Could not find a git repository for SPDXRef-sql-dk (sql-dk)", logger.output)
Expand Down

0 comments on commit b17a45a

Please sign in to comment.