-
Notifications
You must be signed in to change notification settings - Fork 3
test: e2e tests harness + simple_prompt scenario #173
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
luca-iachini
wants to merge
67
commits into
main
Choose a base branch
from
fir-368-e2e-tests
base: main
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
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
227869c
feat(tests): e2e integration harness + normal_llm_call scenario
luca-iachini c7a30d2
refactor(tests): rename integration_tests → e2e
luca-iachini 5decd46
feat(tests): add remaining e2e enforcement scenarios
luca-iachini 9ec6259
fix(run): wrap authority config in [authority] section before spawn
luca-iachini 17b877d
fix(run): strip TLS + ephemeral port in resolve_persisted_paths
luca-iachini 5c0e80d
fix(run): pin ca.dir to marker dir in synthesized sidecar config
luca-iachini d7709df
split harness module
luca-iachini ba8badd
fix clippy
luca-iachini d399954
test(e2e): keep only normal_llm_call on this branch
luca-iachini 8fcaed3
ci: fix test binary name integration_tests → e2e
luca-iachini 708ceab
test(e2e): pass --allow-non-structural when bwrap unavailable
luca-iachini 53da9ee
test(e2e): assert baseline passed before checking enforcement
luca-iachini 54a921d
test(e2e): capture partial output on agent timeout
luca-iachini 4d66062
test(e2e): use fs_err for audit log reads, explain non-JSON lines
luca-iachini 6664bb9
test(e2e): use insta snapshot for normal_llm_call allow event
luca-iachini d0a533a
docs(e2e): drop protoc from prerequisites (already in CLAUDE.md)
luca-iachini d6ad672
test(e2e): nextest setup script + make e2e entry point
luca-iachini 733be59
test(e2e): explain why mock server is hand-rolled vs wiremock
luca-iachini 4fa738a
fix clippy
luca-iachini abf5ca9
test(e2e): remove stale comment in audit log parser
luca-iachini 62cfc5f
Revert "test(e2e): remove stale comment in audit log parser"
luca-iachini 1a2a9d2
test(e2e): error on non-audit lines in audit log
luca-iachini 7c0ddab
refactor audit parsing
luca-iachini 8e6eeca
feat(e2e): simple_prompt scenario — greeting to LLM provider
luca-iachini 757e171
better insta
luca-iachini 511f119
refactor(e2e): replace hand-rolled mock server with wiremock
luca-iachini 9c39b0d
refactor(e2e): expose wiremock directly in ScenarioSetup
luca-iachini 557371d
use wiremock types
luca-iachini 00accb2
fix(mappings): classify *.chatgpt.com subdomains as communication.ext…
luca-iachini 72dc539
fix(e2e): always build debug + point firma_bin() at it
luca-iachini e202b12
fix audit trail snapshot assert
luca-iachini 4d073b9
Merge origin/main into fir-368-e2e-tests
luca-iachini 34192a4
refactor(e2e): inline audit path toml edit
luca-iachini 8bea09a
refactor
luca-iachini 4ab871b
refresh snap
luca-iachini f1f8ddb
fix: drop stale firma-protobuf gitlink after merge
luca-iachini d3d5c58
fix fmt
luca-iachini 9d9d599
fix test assertion
luca-iachini 01071e7
rename to e2e tests
luca-iachini 6e5f99a
fix(mappings): add *.openai.com CONNECT + REST rules
luca-iachini 171f801
refactor audit trail
luca-iachini a8fd390
refactor runner
luca-iachini 428a145
use nextest in the workflow
luca-iachini 781d1cf
simplify bin discovery
luca-iachini 9670be8
remove doctor
luca-iachini 94739ca
simplify readme
luca-iachini 12a2194
simplify config writing
luca-iachini d4cf277
refactor runner
luca-iachini c314b2c
do not replace dev.cedar
luca-iachini 30a797e
add --allow-non-structural for macOs
luca-iachini 684f704
Merge remote-tracking branch 'origin/main' into fir-368-e2e-tests
luca-iachini 8dba1ec
remove old snap
luca-iachini 13d6ccd
remove unused helpers
luca-iachini f0b749b
fix line number
luca-iachini b3d6b3e
remove dead code
luca-iachini f5632a6
remove leftover
luca-iachini 9bf6c22
update action tag
luca-iachini 62112be
Merge remote-tracking branch 'origin/main' into fir-368-e2e-tests
luca-iachini ba3b254
add codex authentication step
luca-iachini 10e3d18
suppress datadog calls
luca-iachini 9d3b55b
simply changes
luca-iachini e47fedc
fix clippy
luca-iachini a2a2cdb
add apparmor bwrap profile
luca-iachini ada8352
wip test
luca-iachini 7983396
update insta for api key scenario
luca-iachini 113581d
fix advisory
luca-iachini 51c5ed8
remove workflow trigger
luca-iachini 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 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,100 @@ | ||
| name: E2E Tests | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: e2e-tests-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: e2e (${{ matrix.os }}, ${{ matrix.agent.name }}) | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| agent: | ||
| - name: claude | ||
| package: "@anthropic-ai/claude-code" | ||
| - name: codex | ||
| package: "@openai/codex" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1 | ||
| with: | ||
| rustflags: "" | ||
| cache: false | ||
|
|
||
| - name: Install cargo-binstall | ||
| uses: cargo-bins/cargo-binstall@30b5ca8b54e1dcffd9548bc87ede1531310fdc67 # v1.20.0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Load tool versions | ||
| shell: bash | ||
| run: grep -E '^[A-Z0-9_]+=' tool-versions.env >> "$GITHUB_ENV" | ||
| - name: Install cargo-nextest | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: command -v cargo-nextest || cargo binstall -y --force --locked cargo-nextest@$CARGO_NEXTEST_VERSION | ||
| shell: bash | ||
|
|
||
| - name: Install protoc | ||
| uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Install bubblewrap (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: sudo apt-get install -y bubblewrap | ||
|
|
||
| # Ubuntu 24.04 ships kernel.apparmor_restrict_unprivileged_userns=1, which | ||
| # transitions bwrap to a profile that strips CAP_NET_ADMIN inside its user | ||
| # namespace, so it cannot bring up loopback (RTM_NEWADDR). Install the | ||
| # targeted AppArmor profile that lets bwrap keep its caps in the userns. | ||
| - name: Allow bwrap user namespaces via AppArmor profile (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo tee /etc/apparmor.d/bwrap >/dev/null <<'EOF' | ||
| abi <abi/4.0>, | ||
| include <tunables/global> | ||
|
|
||
| profile bwrap /usr/bin/bwrap flags=(unconfined) { | ||
| userns, | ||
| include if exists <local/bwrap> | ||
| } | ||
| EOF | ||
| sudo apparmor_parser -r /etc/apparmor.d/bwrap | ||
|
|
||
| - name: Install ${{ matrix.agent.name }} | ||
| run: | | ||
| npm install -g '${{ matrix.agent.package }}' | ||
| ${{ matrix.agent.name }} --version | ||
|
|
||
| - name: Authenticate codex | ||
| if: matrix.agent.name == 'codex' | ||
| run: printenv OPENAI_API_KEY | codex login --with-api-key | ||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
|
|
||
| # nextest builds the firma binary as part of the e2e test; firma_bin() | ||
| # reads its path from CARGO_BIN_EXE_firma. | ||
| - name: Run e2e tests | ||
| env: | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| run: cargo nextest run -p firma --test e2e --run-ignored all -E 'test(/${{ matrix.agent.name }}::/)' | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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 |
|---|---|---|
| @@ -1,23 +1,35 @@ | ||
| # OpenAI API mapping. | ||
| # Tunnels through without MITM; the LLM SDK does not need to trust firma-ca. | ||
|
|
||
| # API-key traffic (api.openai.com, etc.) — single-label wildcard. | ||
| [[rules]] | ||
| method = "CONNECT" | ||
| host = "api.openai.com" | ||
| host = "*.openai.com" | ||
| action_class = "communication.external.send" | ||
|
|
||
| [[rules]] | ||
| method = "CONNECT" | ||
| host = "chatgpt.com" | ||
| action_class = "communication.external.send" | ||
|
|
||
| # Subdomains (ab.chatgpt.com, etc.) — single-label wildcard. | ||
| [[rules]] | ||
| method = "CONNECT" | ||
| host = "*.chatgpt.com" | ||
| action_class = "communication.external.send" | ||
|
|
||
| # REST fallback (plain HTTP proxy or post-MITM). | ||
| [[rules]] | ||
| host = "api.openai.com" | ||
| host = "*.openai.com" | ||
| path = "*" | ||
| action_class = "communication.external.send" | ||
|
|
||
| [[rules]] | ||
| host = "chatgpt.com" | ||
| path = "*" | ||
| action_class = "communication.external.send" | ||
|
|
||
| [[rules]] | ||
| host = "*.chatgpt.com" | ||
| path = "*" | ||
| action_class = "communication.external.send" |
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.
Uh oh!
There was an error while loading. Please reload this page.