Skip to content

Commit

Permalink
changed pytest flags
Browse files Browse the repository at this point in the history
  • Loading branch information
luis committed Feb 5, 2025
1 parent 1218b8a commit 77d8d70
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 67 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/essential-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Essential Run Test - Pull Request

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
run-tests:
strategy:
fail-fast: true
matrix:
markers:
#- acl
- cold_storage
- basic
- presign
#- bucket_versioning
#- policy
uses: ./.github/workflows/run-tests.yml
with:
name: "${{ matrix.markers }}" # Markers must have no special chars, so you can use them as test_names
test: "*_test.py"
config: "../params.example.yaml"
flags: "--no-header -vv -n auto --tb=short --color=no -m '${{ matrix.markers }}' --tb=line"
secrets:
PROFILES: ${{ secrets.PROFILES }}

cleanup-tests:
needs: [run-tests]
if: always()
uses: ./.github/workflows/cleanup-tests.yml
secrets:
PROFILES: ${{ secrets.PROFILES }}
2 changes: 2 additions & 0 deletions .github/workflows/manual-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ jobs:
flags: ${{ inputs.flags }}
secrets:
PROFILES: ${{ secrets.PROFILES }}


40 changes: 40 additions & 0 deletions .github/workflows/optional-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Optional Run Test - Pull Request

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
# since locking is a feature currently under preview, we run it separatedely
# and dont block merges if they fail
run-locking-tests:
strategy:
fail-fast: false
matrix:
marker:
- flag: "not cli and locking"
name: "not_cli_and_locking"
config:
- path: "../params/br-ne1.yaml"
name: "ne1"
- path: "../params/br-se1.yaml"
name: "se1"

uses: ./.github/workflows/run-tests.yml
with:
name: "${{matrix.marker.name}}_${{matrix.config.name}}" # Combination of values to represent the test
test: "*_test.py"
config: "${{ matrix.config.path }}"
# no multiple workers here just to make it easier to audit the logs (more verbosity with INFO level)
flags: "--no-header -v -n auto --log-cli-level INFO --color=no -m '${{matrix.marker.flag}}'"
secrets:
PROFILES: ${{ secrets.PROFILES }}

cleanup-tests:
needs: [run-locking-tests]
if: always()
uses: ./.github/workflows/cleanup-tests.yml
secrets:
PROFILES: ${{ secrets.PROFILES }}


59 changes: 0 additions & 59 deletions .github/workflows/pull-request-test.yml

This file was deleted.

17 changes: 10 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Run Tests
on:
workflow_call:
inputs:
tests: { required: false, type: string }
name: { required: true, type: string }
test: { required: true, type: string }
config: { required: true, type: string }
flags: { required: true, type: string }
secrets:
Expand Down Expand Up @@ -49,12 +50,14 @@ jobs:
echo "Configuring Profiles..."
uv run python ./bin/configure_profiles.py ./profiles.yaml
- name: Run tests ${{ inputs.tests }}
- name: Run tests ${{ inputs.name }}
run: |
cd docs
mkdir -p s3-specs/artifact/
uv run pytest --config ${{ inputs.config }} *_test.py ${{ inputs.flags }} | tee s3-specs/artifact/output_${{inputs.tests}}.log
- uses: actions/upload-artifact@v4
mkdir -p /s3-specs/artifact/
uv run pytest --config ${{ inputs.config }} ${{inputs.test}} ${{ inputs.flags }} | tee /s3-specs/artifact/output_${{ inputs.name }}.log
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: output_artifact_${{ inputs.tests }}
path: s3-specs/artifact/output_${{inputs.tests}}.log
name: output_artifact_${{ inputs.name }}_${{ job.container.id }}
path: /s3-specs/artifact/output_${{ inputs.name }}.log
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ params.yaml
**/__pycache__/

# Ignore pytest debug log file
pytestdebug.log
pytestdebug.log

0 comments on commit 77d8d70

Please sign in to comment.