Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/duvet-test-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6

# There are a lot of submodules here
# This initializes the checkouts in parallel (--jobs)
# rather than in series the way actions/checkout@v5 does it.
# rather than in series the way actions/checkout@v6 does it.

- name: Get CPU count
id: cpu-count
Expand All @@ -42,7 +42,7 @@ jobs:


- name: Checkout CPP code cpp-v3
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: recursive
repository: aws/aws-sdk-cpp
Expand All @@ -64,7 +64,7 @@ jobs:

- name: Upload duvet reports
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: test-server-reports
include-hidden-files: true
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Upload compliance dashboard
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: compliance-dashboard
include-hidden-files: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/duvet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: make duvet

- name: Upload duvet reports
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: reports
include-hidden-files: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/python-integ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: false

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.11' }}

- name: Cache uv dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('./test-server/python-v3-server/**/pyproject.toml') }}
Expand All @@ -42,7 +42,7 @@ jobs:
run: make install

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::370957321024:role/S3EC-Python-Github-test-role
aws-region: us-west-2
Expand All @@ -55,3 +55,24 @@ jobs:
env:
CI_S3_BUCKET: ${{ vars.CI_S3_BUCKET }}
CI_KMS_KEY_ALIAS: ${{ vars.CI_KMS_KEY_ALIAS }}

- name: Generate coverage HTML report
if: always()
run: uv run coverage html -d coverage-report

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage-report/

- name: Check coverage threshold
run: |
THRESHOLD=93
ACTUAL=$(uv run coverage report --format=total)
echo "Coverage: ${ACTUAL}% (threshold: ${THRESHOLD}%)"
if [ "$ACTUAL" -gt "$THRESHOLD" ]; then
echo "::warning::Coverage is ${ACTUAL}%, consider updating --fail-under to ${ACTUAL} in python-integ.yml"
fi
uv run coverage report --fail-under=$THRESHOLD
12 changes: 6 additions & 6 deletions .github/workflows/test-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: false
token: ${{ secrets.PAT_FOR_SPEC }}

# There are a lot of submodules here
# This initializes the checkouts in parallel (--jobs)
# rather than in series the way actions/checkout@v5 does it.
# rather than in series the way actions/checkout@v6 does it.

- name: Get CPU count
id: cpu-count
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

# Cache Gradle dependencies and build outputs
- name: Cache Gradle packages
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
Expand All @@ -100,7 +100,7 @@ jobs:
${{ runner.os }}-gradle-

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::370957321024:role/S3EC-Python-Github-test-role
aws-region: us-west-2
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:

- name: Upload server logs
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: server-logs
path: |
Expand All @@ -144,7 +144,7 @@ jobs:

- name: Upload results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: results
path: test-server/java-tests/build/reports/tests/integ
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ smithy-java-core/out

# test server
*.pid
.coverage
coverage-report/
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ format:
uv run black src/ test/
uv run ruff check --fix src/ test/

# Run all tests
# Run all tests with combined coverage
test: test-unit test-integration

# Run unit tests
# Run unit tests (creates .coverage report)
test-unit:
uv run pytest test/ --ignore=test/integration/ --verbose
uv run pytest test/ --ignore=test/integration/ --verbose --cov=src/s3_encryption --cov-report=term-missing

# Run integration tests
# Run integration tests (appends to .coverage report from test-unit)
test-integration:
uv run pytest test/integration/ --verbose
uv run pytest test/integration/ --verbose --cov=src/s3_encryption --cov-append --cov-report=term-missing

# Clean up cache files
clean:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies = [
[project.optional-dependencies]
test = [
"pytest>=8.4.1",
"pytest-cov>=6.1.1",
]
dev = [
"black>=24.3.0,<27.0.0",
Expand Down Expand Up @@ -61,3 +62,9 @@ known-first-party = ["s3_encryption"]
[tool.ruff.lint.per-file-ignores]
"test/**/*.py" = ["D100", "D101", "D102", "D103", "D104", "E501"]
"src/s3_encryption/pipelines.py" = ["E501"]

[tool.coverage.run]
source = ["src/s3_encryption"]

[tool.coverage.report]
show_missing = true
Loading