-
Notifications
You must be signed in to change notification settings - Fork 2
chore(xtest): Audit and local improvements together #390
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
base: main
Are you sure you want to change the base?
chore(xtest): Audit and local improvements together #390
Conversation
dmihalcik-virtru
commented
Jan 27, 2026
- feat(xtest): add tmux-based local test environment with modular scripts
- feat(xtest): add audit log processing framework and test integration
Summary of ChangesHello @dmihalcik-virtru, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly overhauls the local testing infrastructure for the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new audit logging framework for tests and refactors the local test environment to use a modular, tmux-based shell script system. The changes are extensive and well-structured. The new audit log framework is a great addition for improving test diagnostics, and the shell script refactoring improves maintainability. I've found a critical issue in a path helper function within the new script library and some minor path issues in the updated documentation. Overall, this is a significant improvement to the test infrastructure.
xtest/scripts/lib/core/paths.sh
Outdated
| get_platform_dir() { | ||
| local xtest_dir | ||
| xtest_dir="$(get_xtest_dir)" | ||
| echo "$(cd "$xtest_dir/../../platform" && pwd)" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_platform_dir function appears to construct an incorrect path. It uses cd "$xtest_dir/../../platform", which resolves to a directory one level above the repository root. Assuming the platform directory is a sibling of the xtest directory within the repository, the correct relative path should be ../platform from the xtest directory.
| get_platform_dir() { | |
| local xtest_dir | |
| xtest_dir="$(get_xtest_dir)" | |
| echo "$(cd "$xtest_dir/../../platform" && pwd)" | |
| } | |
| get_platform_dir() { | |
| local xtest_dir | |
| xtest_dir="$(get_xtest_dir)" | |
| echo "$(cd "$xtest_dir/../platform" && pwd)" | |
| } |
|
|
||
| ## Build, Test, and Development Commands | ||
| ### Structure | ||
| - **Test Directory**: `tests/xtest/` - pytest-based integration tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation contains a few incorrect paths that could confuse users:
- On line 8, the test directory should be
xtest/, nottests/xtest/. - Several example commands (e.g., on lines 347, 361, 362, 714) use paths like
platform/opentdf-dev.yaml. Since test commands are typically run from thextest/directory, the correct relative path to the platform directory would be../platform/.
7dfa6b5 to
41fc3fe
Compare
72912d1 to
ec8afbd
Compare
- Implement lmgmt Python CLI tool for managing local test environment - Add service abstraction (Platform, KAS, Docker, Provisioner) - Implement health checks and wait utilities - Add structured log aggregation with filtering capabilities - Include comprehensive pytest integration tests - Update CI workflows for audit log collection
- Add comprehensive audit log test coverage for TDF roundtrip, ABAC, and policy tests - Implement clock skew estimation for accurate timestamp comparison - Increase audit log assertion timeout and report late-arriving logs - Add integration tests for audit log collection in CI pipeline - Make audit assertions required by default with override option
- Fix subprocess deadlock in otdfctl by properly handling stdout/stderr - Capture stderr output for better debugging when CLI calls fail - Add env command to lmgmt for outputting pytest environment variables
- Document lmgmt Python CLI as recommended tool for environment management - Add quick reference commands for service management - Update troubleshooting workflow to use lmgmt - Include audit log assertions requirements and disabling procedures
- Add .shfmt configuration for shell script formatting - Update .gitignore for generated files - Update xtest dependencies and manifest schema
Export the manifest schema file path in the lmgmt env command to support manifest validation tests. Tests can now validate TDF manifests against the schema without requiring manual SCHEMA_FILE configuration. Co-Authored-By: Claude Haiku 4.5 <[email protected]>
- Add setup_golden_keys() to extract keys from extra-keys.json - Platform service now automatically adds golden-r1 key on startup - Add append_to_list() YAML helper with deduplication by kid - Update AGENTS.md with golden key configuration documentation This enables test_legacy.py golden file tests to work automatically when the environment is started with `lmgmt up`. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Convert kas_registry_create_if_not_present to use upsert pattern: - Try to create KAS entry - On 'already_exists' / 'unique field violation', list and verify existing - Verify public keys match expectations (when entry has keys populated) - Allow entries without keys (added later via kas_registry_create_public_key_only) Fixes concurrent pytest-xdist workers attempting simultaneous KAS registration. Applies same recovery pattern already used by kas_registry_create_public_key_only and kas_registry_import_key methods. Co-Authored-By: Claude Haiku 4.5 <[email protected]>
…lue expectations Replace polling-based audit log assertion loops with Condition-based wakeup so assertion threads are notified immediately when new log data arrives instead of sleeping 100ms between checks. Also fix two tests that expected separate attribute_value audit events when the platform embeds values in the attribute_definition event. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Apply the same upsert pattern used in kas_registry_create_public_key_only and kas_registry_import_key: on already_exists/unique field violation, fetch and return the existing key instead of asserting. This fixes concurrent xdist workers racing to create the same managed key. Also relax attribute_value count assertion to >= since concurrent workers may create additional attribute_definition events. Co-Authored-By: Claude Opus 4.6 <[email protected]>
8d79d5c to
4374e9c
Compare
Queries Go git tags, npm registry, Maven Central, and GitHub Releases to list available CLI versions with install methods. Supports --stable, --latest N, --table, and --releases filters. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add configure.py to install SDK CLIs from registries (Go via go run, JS via npm, Java via GitHub Releases) instead of always building from source. CI now skips checkout+make for released versions, reserving source builds for head/branch/PR testing only. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|



