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
45 changes: 45 additions & 0 deletions .github/workflows/duvet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Tests

on:
workflow_call:
# Optional inputs that can be provided when calling this workflow

jobs:
test:
runs-on: macos-latest
permissions:
id-token: write
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.PAT_FOR_PRIVATE_RUBY }}

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Clone duvet repository
run: git clone https://github.com/awslabs/duvet.git /tmp/duvet

- name: Build and install duvet
run: |
cd /tmp/duvet
cargo xtask build
cargo install --path ./duvet

- name: Run duvet
if: always()
run: cd test-server && make duvet

- name: Upload duvet reports
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
include-hidden-files: true
path: test-server/*-server/.duvet/reports/report.html
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ jobs:
with:
python-version: ${{ inputs.python-version || '3.11' }}
secrets: inherit

run-duvet:
name: Run Duvet
uses: ./.github/workflows/duvet.yml
secrets: inherit
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
[submodule "test-server/specification"]
path = test-server/specification
url = git@github.com:awslabs/private-aws-encryption-sdk-specification-staging.git
branch = fire-egg-staging
7 changes: 7 additions & 0 deletions test-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ test-create-client:
-H "User-Agent: smithy-java/0.0.3 ua/2.1 os/macos#15.5 lang/java#23.0.2" \
-d '{"config":{"enableLegacyUnauthenticatedModes":false,"enableDelayedAuthenticationMode":false,"enableLegacyWrappingAlgorithms":false,"keyMaterial":{"kmsKeyId":"arn:aws:kms:us-west-2:370957321024:alias/S3EC-Test-Server-Github-KMS-Key"}}}' \
http://localhost:$(PORT)/client

duvet:
@echo "Running duvet reports..."
@for dir in $(SERVER_DIRS); do \
echo "Running make duvet in $$dir..."; \
$(MAKE) -C $$dir duvet; \
done
26 changes: 26 additions & 0 deletions test-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,29 @@ Performance optimizations have been implemented to speed up the test-server CI p
- JVM optimizations

For detailed information about the optimizations, see [OPTIMIZATION.md](./OPTIMIZATION.md).

### Duvet

To check duvet you need to install Rust.
Until the latest version of Duvet is release

```bash
git clone https://github.com/awslabs/duvet.git /tmp/duvet
pushd /tmp/duvet
cargo xtask build
cargo install --path ./duvet
popd rm -rf /tmp/duvet
```

Inside each test server directory there is a `.duvet` directory that contains a `config.toml`.
This is the best way to configure `duvet`.

You can adjust the source pattern or comment style as needed.
Examples:

- `ruby-v2-server/.duvet/config.toml`
- `php-v2-server/.duvet/config.toml`

There are Makefile targets,
but you can just run `make duvet` or `duvet report` inside a server directory to run the report.
To view the report `make view-report-mac` or `open .duvet/reports/report.html`
3 changes: 3 additions & 0 deletions test-server/cpp-v2-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
24 changes: 24 additions & 0 deletions test-server/cpp-v2-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "aws-sdk-cpp/src/aws-cpp-sdk-s3-encryption/**/*.cpp"

[[source]]
pattern = "aws-sdk-cpp/src/aws-cpp-sdk-s3-encryption/**/*.h"

# Include required specifications here
[[specification]]
Comment thread
seebees marked this conversation as resolved.
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
6 changes: 6 additions & 0 deletions test-server/cpp-v2-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ stop-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 3 additions & 0 deletions test-server/go-v3-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
21 changes: 21 additions & 0 deletions test-server/go-v3-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "**/*.go"

# Include required specifications here
[[specification]]
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
6 changes: 6 additions & 0 deletions test-server/go-v3-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ stop-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 3 additions & 0 deletions test-server/java-v3-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
21 changes: 21 additions & 0 deletions test-server/java-v3-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "**/*.java"

# Include required specifications here
[[specification]]
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
1 change: 1 addition & 0 deletions test-server/java-v3-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/
6 changes: 6 additions & 0 deletions test-server/java-v3-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ stop-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 3 additions & 0 deletions test-server/net-v2-v3-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
21 changes: 21 additions & 0 deletions test-server/net-v2-v3-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "**/*.cs"

# Include required specifications here
[[specification]]
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
8 changes: 7 additions & 1 deletion test-server/net-v2-v3-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ start-net-v3-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT_NET_V2) \
$(MAKE) -C .. wait-for-port PORT=$(PORT_NET_V3)
$(MAKE) -C .. wait-for-port PORT=$(PORT_NET_V3)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 3 additions & 0 deletions test-server/php-v2-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
24 changes: 24 additions & 0 deletions test-server/php-v2-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "local-php-sdk/src/S3/**/*.php"
Comment thread
josecorella marked this conversation as resolved.

[[source]]
pattern = "local-php-sdk/src/Crypto/**/*.php"

# Include required specifications here
[[specification]]
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
6 changes: 6 additions & 0 deletions test-server/php-v2-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ stop-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 3 additions & 0 deletions test-server/php-v3-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
24 changes: 24 additions & 0 deletions test-server/php-v3-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "local-php-sdk/src/S3/**/*.php"
Comment thread
josecorella marked this conversation as resolved.

[[source]]
pattern = "local-php-sdk/src/Crypto/**/*.php"

# Include required specifications here
[[specification]]
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
6 changes: 6 additions & 0 deletions test-server/php-v3-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ stop-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 3 additions & 0 deletions test-server/python-v3-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reports/
requirements/
specification/
22 changes: 22 additions & 0 deletions test-server/python-v3-server/.duvet/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"

[[source]]
pattern = "**/*.py"
comment-style = { meta = "##=", content = "##%" }

# Include required specifications here
[[specification]]
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = false
6 changes: 6 additions & 0 deletions test-server/python-v3-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ stop-server:

wait-for-server:
$(MAKE) -C .. wait-for-port PORT=$(PORT)

duvet:
duvet report

view-report-mac:
open .duvet/reports/report.html
3 changes: 2 additions & 1 deletion test-server/ruby-v2-server/.duvet/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
reports/
requirements/
requirements/
specification/
6 changes: 5 additions & 1 deletion test-server/ruby-v2-server/.duvet/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ comment-style = { meta = "##=", content = "##%" }
source = "../specification/s3-encryption/data-format/content-metadata.md"
[[specification]]
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
[[specification]]
source = "../specification/s3-encryption/encryption.md"
[[specification]]
source = "../specification/s3-encryption/key-derivation.md"

[report.html]
enabled = true

# Enable snapshots to prevent requirement coverage regressions
[report.snapshot]
enabled = true
enabled = false
Loading
Loading