-
Notifications
You must be signed in to change notification settings - Fork 8
fix: fix Minimal Tests workflow for OSS repo structure #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0eff588
fix: fix Minimal Tests workflow for OSS repo structure
abhizipstack fc943d2
fix: use Python 3.10 in Minimal Tests — matches pyproject.toml constr…
abhizipstack acf3618
fix: remove pre-commit step — handled by pre-commit.ci now
abhizipstack 57fd176
fix: install test dependencies in setup-python action
abhizipstack 7087e1d
fix: ignore integration_tests in CI — they need external services
abhizipstack 32e931b
fix: run only tests/unit — exclude integration and unit_tests dirs
abhizipstack bc94efa
fix: fix test paths and update outdated incremental validation test
abhizipstack e33e3dc
fix: set DJANGO_SETTINGS_MODULE for test step in CI
abhizipstack d76e8b2
fix: update SonarCloud project key to match dashboard
abhizipstack e964a01
fix: make SonarCloud scan non-blocking with continue-on-error
abhizipstack cef1a1a
fix: bump docformatter to v1.7.7 — python_venv not supported in CI
abhizipstack 264d1b9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,73 +1,71 @@ | ||
| --- | ||
| name: Minimal Tests | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| FORCE_COLOR: "1" | ||
|
|
||
| jobs: | ||
| minimal_tests: | ||
| name: Minimal Tests | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| python-version: ["3.10"] | ||
| defaults: | ||
| run: | ||
| working-directory: backend | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| lfs: true | ||
|
|
||
| - name: Setup Python | ||
| uses: ./.github/actions/setup-python/ | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: [ "main"] | ||
| # pre-commit checks handled by pre-commit.ci | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
| env: | ||
| FORCE_COLOR: "1" | ||
| jobs: | ||
| minimal_tests: | ||
| name: Minimal Tests | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| python-version: ["3.11"] #,"3.9","3.10"] | ||
| steps: | ||
| #---------------------------------------------- | ||
| # check-out repo and set-up python | ||
| #---------------------------------------------- | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| lfs: true | ||
| - name: Setup Python | ||
| uses: ./.github/actions/setup-python/ | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Cache pre-commit hooks | ||
| uses: actions/cache@v4 | ||
| if: github.ref != 'refs/heads/main' | ||
| with: | ||
| path: ~/.cache/pre-commit | ||
| key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
| - name: Run tests | ||
| env: | ||
| DJANGO_SETTINGS_MODULE: backend.server.settings.dev | ||
| run: | | ||
| uv run coverage run --rcfile=pyproject.toml --source=. -m \ | ||
| pytest -x -vv ../tests/unit \ | ||
| --ignore=../tests/unit/test_logs.py \ | ||
| --ignore=../tests/unit/test_visitran_adapters \ | ||
| --ignore=../tests/unit/test_visitran_backend \ | ||
| -m "not snowflake and not bigquery and not trino and not postgres" | ||
|
|
||
| - name: Check pre-commit | ||
| if: github.ref != 'refs/heads/main' | ||
| run: | | ||
| uv run pre-commit run --all-files | ||
| - name: Run minimal core tests | ||
| run: | | ||
| uv run coverage run --rcfile=pyproject.toml --data-file=minimal.cov --context="minimal" --source=. -m \ | ||
| pytest -x -vv -m "not snowflake and not bigquery and not trino and not postgres" | ||
| - name: Run backend tests | ||
| run: | | ||
| uv run coverage run --rcfile=pyproject.toml --data-file=backend.cov --context="backend" --source=. -m \ | ||
| pytest -x -vv ./visitran_backend | ||
| - name: Generate coverage report | ||
| run: | | ||
| uv run coverage report -m | ||
| uv run coverage xml | ||
|
|
||
| - name: Combine to coverage xml | ||
| run: | | ||
| uv run coverage combine backend.cov minimal.cov | ||
| uv run coverage report -m | ||
| uv run coverage xml | ||
| - name: Git fetch unshallow | ||
| run: | | ||
| git fetch --unshallow | ||
| - name: Git fetch unshallow | ||
| working-directory: . | ||
| run: git fetch --unshallow | ||
|
|
||
| - name: Core SonarCloud Scan | ||
| uses: SonarSource/sonarcloud-github-action@master | ||
| if: ${{ github.actor != 'dependabot[bot]' }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| with: | ||
| projectBaseDir: ./ | ||
| args: > | ||
| -Dproject.settings=./sonar-project.properties | ||
| - name: SonarCloud Scan | ||
| uses: SonarSource/sonarcloud-github-action@master | ||
| if: ${{ github.actor != 'dependabot[bot]' }} | ||
| continue-on-error: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| with: | ||
| projectBaseDir: ./ | ||
| args: > | ||
| -Dproject.settings=./sonar-project.properties | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,4 +213,4 @@ backend/backend/utils/load_models/yaml_models.yaml | |
|
|
||
| # macOS | ||
| .DS_Store | ||
| **/.DS_Store | ||
| **/.DS_Store | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| from dotenv import load_dotenv | ||
|
|
||
| from .celery import app as celery_app | ||
| from backend.backend.celery import app as celery_app | ||
|
|
||
| load_dotenv() | ||
| __all__ = ["celery_app"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.