-
Notifications
You must be signed in to change notification settings - Fork 98
Run regression on CI #294
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
Open
mcopik
wants to merge
12
commits into
master
Choose a base branch
from
feature/circle-ci-jobs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Run regression on CI #294
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2d8817d
[regression] Multiple bug fixes
mcopik 7cbc681
[ci] Update test job
mcopik eb4d0e0
[ci] Update test job
mcopik 2b19309
[ci] Enable CI job on feature branches
mcopik 09a350c
[ci] Fix CI command
mcopik e9185a1
[ci] Fix CI command
mcopik 5334168
[regression] Non-zero return from failed registration
mcopik 1fac84b
[aws] Remove unnecessary pkg_resources from container
mcopik a0d82f2
[ci] Fixes
mcopik 7454aac
[ci] Migrate from CircleCI to GH Actions
mcopik 62a6f31
[ci] Fixes
mcopik 6615792
[dev] Linting
mcopik 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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| name: Regression Job (Reusable) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| platform: | ||
| required: true | ||
| type: string | ||
| language: | ||
| required: true | ||
| type: string | ||
| version: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| RESOURCE_PREFIX: sebs-ci | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Restore SeBS cache | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: regression-cache/ | ||
| key: sebs-cache-${{ github.ref_name }}-${{ inputs.platform }}-${{ inputs.language }}-${{ inputs.version }} | ||
| restore-keys: | | ||
| sebs-cache-${{ github.ref_name }}- | ||
|
|
||
| - name: Setup GCP credentials | ||
| if: inputs.platform == 'gcp' | ||
| run: | | ||
| echo "${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}" > /tmp/gcp-credentials.json | ||
| echo "GOOGLE_APPLICATION_CREDENTIALS=/tmp/gcp-credentials.json" >> $GITHUB_ENV | ||
|
|
||
| - name: Setup Azure credentials | ||
| if: inputs.platform == 'azure' | ||
| run: | | ||
| echo "AZURE_SUBSCRIPTION_ID=${{ secrets.AZURE_SUBSCRIPTION_ID }}" >> $GITHUB_ENV | ||
| echo "AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}" >> $GITHUB_ENV | ||
| echo "AZURE_CLIENT_ID=${{ secrets.AZURE_CLIENT_ID }}" >> $GITHUB_ENV | ||
| echo "AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Setup AWS credentials | ||
| if: inputs.platform == 'aws' | ||
| run: | | ||
| echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV | ||
| echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV | ||
| echo "AWS_DEFAULT_REGION=${{ secrets.AWS_DEFAULT_REGION || 'us-east-1' }}" >> $GITHUB_ENV | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Install SeBS | ||
| run: uv pip install --system . | ||
|
|
||
| - name: Run regression tests | ||
| timeout-minutes: 5 | ||
| run: | | ||
| sebs benchmark regression test \ | ||
| --config configs/example.json \ | ||
| --deployment ${{ inputs.platform }} \ | ||
| --language ${{ inputs.language }} \ | ||
| --language-version ${{ inputs.version }} \ | ||
| --architecture x64 --selected-architecture \ | ||
| --resource-prefix sebs-ci | ||
|
|
||
| - name: Generate test summary | ||
| if: always() | ||
| run: | | ||
| echo "Regression Test Summary" > test-summary.txt | ||
| echo "======================" >> test-summary.txt | ||
| echo "Platform: ${{ inputs.platform }}" >> test-summary.txt | ||
| echo "Language: ${{ inputs.language }}" >> test-summary.txt | ||
| echo "Version: ${{ inputs.version }}" >> test-summary.txt | ||
| echo "" >> test-summary.txt | ||
| if ls regression_*.json 1> /dev/null 2>&1; then | ||
| ls -1 regression_*.json | wc -l | xargs echo "Benchmarks tested:" >> test-summary.txt | ||
| echo "" >> test-summary.txt | ||
| echo "Results saved to artifacts/results/" >> test-summary.txt | ||
| else | ||
| echo "No benchmark results found" >> test-summary.txt | ||
| fi | ||
|
|
||
| - name: Upload test summary | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-summary-${{ inputs.platform }}-${{ inputs.language }}-${{ inputs.version }} | ||
| path: test-summary.txt | ||
|
|
||
| - name: Collect and upload regression results | ||
| if: always() | ||
| run: | | ||
| mkdir -p results | ||
| if ls regression_*.json 1> /dev/null 2>&1; then | ||
| mv regression_*.json results/ || true | ||
| fi | ||
|
|
||
| - name: Upload regression results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: results-${{ inputs.platform }}-${{ inputs.language }}-${{ inputs.version }} | ||
| path: results/ | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: Upload cache snapshot | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cache-snapshot-${{ inputs.platform }}-${{ inputs.language }}-${{ inputs.version }} | ||
| path: cache/ | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: Save SeBS cache | ||
| if: success() | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: regression-cache/ | ||
| key: sebs-cache-${{ github.ref_name }}-${{ inputs.platform }}-${{ inputs.language }}-${{ inputs.version }} | ||
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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| linting: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Install system dependencies | ||
| run: sudo apt update && sudo apt install -y libcurl4-openssl-dev | ||
|
|
||
| - name: Cache uv dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/uv | ||
| key: uv-${{ runner.os }}-${{ hashFiles('requirements.txt', 'pyproject.toml') }} | ||
| restore-keys: | | ||
| uv-${{ runner.os }}- | ||
|
|
||
| - name: Install SeBS with dev dependencies | ||
| run: uv sync --extra dev | ||
|
|
||
| - name: Python code formatting with black | ||
| run: uv run black sebs --check --config .black.toml | ||
|
|
||
| - name: Python code lint with flake8 | ||
| run: uv run flake8 sebs --config=.flake8.cfg --tee --output-file flake-reports | ||
|
|
||
| - name: Python static code verification with mypy | ||
| run: uv run mypy sebs --config-file=.mypy.ini | ||
|
|
||
| - name: Check for Python documentation coverage | ||
| run: uv run interrogate -v --fail-under 100 sebs | ||
|
|
||
| - name: Upload flake8 reports | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: flake-reports | ||
| path: flake-reports |
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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Regression Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - 'feature/**' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| regression: | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - platform: aws | ||
| language: python | ||
| version: "3.11" | ||
| fail-fast: false | ||
|
|
||
| uses: ./.github/workflows/_regression-job.yml | ||
| with: | ||
| platform: ${{ matrix.platform }} | ||
| language: ${{ matrix.language }} | ||
| version: ${{ matrix.version }} | ||
| secrets: inherit |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upload the correct cache directory in the snapshot artifact.
This workflow restores/saves
regression-cache/, but snapshot upload points tocache/, so the artifact can miss the actual cache used by regression runs.🛠️ Proposed fix
- name: Upload cache snapshot if: always() uses: actions/upload-artifact@v4 with: name: cache-snapshot-${{ inputs.platform }}-${{ inputs.language }}-${{ inputs.version }} - path: cache/ + path: regression-cache/ if-no-files-found: ignore🤖 Prompt for AI Agents