chore: Use embed directive in all tests#113
Merged
clement0010 merged 2 commits intomasterfrom Aug 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes file reading in tests by replacing os.ReadFile calls with Go's embed directive for static test data files. This approach improves performance and ensures test data is bundled with the binary.
- Replaces
os.ReadFilecalls with embedded variables in e2e and http_proxy tests - Adds new embedded variables for server certificates in the test/data package
- Removes unnecessary
ospackage imports where no longer needed
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test/e2e/e2e_test.go | Replaces file reading with embedded proxy certificates and removes os import |
| test/data/data.go | Adds embedded variables for proxy key and server certificates |
| internal/httpproxy/http_proxy_test.go | Updates all TLS certificate loading to use embedded data instead of file reading |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
minhtule
added a commit
that referenced
this pull request
Dec 30, 2025
## Changes - Update fake Twingate client to return the correct resource type in GAT token - Add an integration test for SSH with an OpenSSH server running in Docker - Test that the User can execute commands via SSH through the gateway - Session recording (asciicast) is generated - Test that the User can copy a file from SSH server to host machine via SCP subsystem - Add SSH data files --------- Co-authored-by: Minh Tu Le <minhtu@twingate.com>
minhtule
added a commit
that referenced
this pull request
Dec 30, 2025
* ssh-latest-master: feat: Update tests to use synctest (#139) feat: Support SSH resource for local client setup (#118) feat: Add SSH integration test (#113) feat: Remove `kubenertes` object from asciicast header (#137) Pin helm-unittest version to v1.0.3 Nicer code feat: Add SSH audit logging for each SSH request (#130) feat: Start session recording for SSH interactive session only (#128) fix(cert-reloader): Fix flaky test (#116) fix: Flaky SSH and HTTP handler tests (#127) Nicer code Improve error messages # Conflicts: # go.mod # internal/config/config_test.go # internal/sshhandler/proxy.go
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
http_proxyunit test to useembeddirective instead ofos.ReadFile