Skip to content

Commit 3fa2d35

Browse files
authored
Merge branch 'fireegg-test-servers' into seebees/add-filter
2 parents ccb21d8 + 68e5853 commit 3fa2d35

36 files changed

Lines changed: 367 additions & 94 deletions

File tree

.github/workflows/duvet.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Run Tests
2+
3+
on:
4+
workflow_call:
5+
# Optional inputs that can be provided when calling this workflow
6+
7+
jobs:
8+
test:
9+
runs-on: macos-latest
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: true
19+
token: ${{ secrets.PAT_FOR_PRIVATE_RUBY }}
20+
21+
- name: Setup Rust toolchain
22+
uses: actions-rust-lang/setup-rust-toolchain@v1
23+
with:
24+
toolchain: stable
25+
26+
- name: Clone duvet repository
27+
run: git clone https://github.com/awslabs/duvet.git /tmp/duvet
28+
29+
- name: Build and install duvet
30+
run: |
31+
cd /tmp/duvet
32+
cargo xtask build
33+
cargo install --path ./duvet
34+
35+
- name: Run duvet
36+
if: always()
37+
run: cd test-server && make duvet
38+
39+
- name: Upload duvet reports
40+
if: always()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: reports
44+
include-hidden-files: true
45+
path: test-server/*-server/.duvet/reports/report.html

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ jobs:
2323
with:
2424
python-version: ${{ inputs.python-version || '3.11' }}
2525
secrets: inherit
26+
27+
run-duvet:
28+
name: Run Duvet
29+
uses: ./.github/workflows/duvet.yml
30+
secrets: inherit

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
[submodule "test-server/specification"]
2424
path = test-server/specification
2525
url = git@github.com:awslabs/private-aws-encryption-sdk-specification-staging.git
26+
branch = fire-egg-staging

test-server/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,10 @@ test-create-client:
119119
-H "User-Agent: smithy-java/0.0.3 ua/2.1 os/macos#15.5 lang/java#23.0.2" \
120120
-d '{"config":{"enableLegacyUnauthenticatedModes":false,"enableDelayedAuthenticationMode":false,"enableLegacyWrappingAlgorithms":false,"keyMaterial":{"kmsKeyId":"arn:aws:kms:us-west-2:370957321024:alias/S3EC-Test-Server-Github-KMS-Key"}}}' \
121121
http://localhost:$(PORT)/client
122+
123+
duvet:
124+
@echo "Running duvet reports..."
125+
@for dir in $(SERVER_DIRS); do \
126+
echo "Running make duvet in $$dir..."; \
127+
$(MAKE) -C $$dir duvet; \
128+
done

test-server/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,29 @@ Performance optimizations have been implemented to speed up the test-server CI p
6262
- JVM optimizations
6363

6464
For detailed information about the optimizations, see [OPTIMIZATION.md](./OPTIMIZATION.md).
65+
66+
### Duvet
67+
68+
To check duvet you need to install Rust.
69+
Until the latest version of Duvet is release
70+
71+
```bash
72+
git clone https://github.com/awslabs/duvet.git /tmp/duvet
73+
pushd /tmp/duvet
74+
cargo xtask build
75+
cargo install --path ./duvet
76+
popd rm -rf /tmp/duvet
77+
```
78+
79+
Inside each test server directory there is a `.duvet` directory that contains a `config.toml`.
80+
This is the best way to configure `duvet`.
81+
82+
You can adjust the source pattern or comment style as needed.
83+
Examples:
84+
85+
- `ruby-v2-server/.duvet/config.toml`
86+
- `php-v2-server/.duvet/config.toml`
87+
88+
There are Makefile targets,
89+
but you can just run `make duvet` or `duvet report` inside a server directory to run the report.
90+
To view the report `make view-report-mac` or `open .duvet/reports/report.html`
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reports/
2+
requirements/
3+
specification/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"
2+
3+
[[source]]
4+
pattern = "aws-sdk-cpp/src/aws-cpp-sdk-s3-encryption/**/*.cpp"
5+
6+
[[source]]
7+
pattern = "aws-sdk-cpp/src/aws-cpp-sdk-s3-encryption/**/*.h"
8+
9+
# Include required specifications here
10+
[[specification]]
11+
source = "../specification/s3-encryption/data-format/content-metadata.md"
12+
[[specification]]
13+
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
14+
[[specification]]
15+
source = "../specification/s3-encryption/encryption.md"
16+
[[specification]]
17+
source = "../specification/s3-encryption/key-derivation.md"
18+
19+
[report.html]
20+
enabled = true
21+
22+
# Enable snapshots to prevent requirement coverage regressions
23+
[report.snapshot]
24+
enabled = false

test-server/cpp-v2-server/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ stop-server:
2929

3030
wait-for-server:
3131
$(MAKE) -C .. wait-for-port PORT=$(PORT)
32+
33+
duvet:
34+
duvet report
35+
36+
view-report-mac:
37+
open .duvet/reports/report.html
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reports/
2+
requirements/
3+
specification/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'$schema' = "https://awslabs.github.io/duvet/config/v0.4.0.json"
2+
3+
[[source]]
4+
pattern = "**/*.go"
5+
6+
# Include required specifications here
7+
[[specification]]
8+
source = "../specification/s3-encryption/data-format/content-metadata.md"
9+
[[specification]]
10+
source = "../specification/s3-encryption/data-format/metadata-strategy.md"
11+
[[specification]]
12+
source = "../specification/s3-encryption/encryption.md"
13+
[[specification]]
14+
source = "../specification/s3-encryption/key-derivation.md"
15+
16+
[report.html]
17+
enabled = true
18+
19+
# Enable snapshots to prevent requirement coverage regressions
20+
[report.snapshot]
21+
enabled = false

0 commit comments

Comments
 (0)