Skip to content

chore: Use embed directive in all tests#113

Merged
clement0010 merged 2 commits intomasterfrom
chore/use-embed-directive-everywhere
Aug 22, 2025
Merged

chore: Use embed directive in all tests#113
clement0010 merged 2 commits intomasterfrom
chore/use-embed-directive-everywhere

Conversation

@clement0010
Copy link
Copy Markdown
Contributor

Changes

  • Update e2e test and http_proxy unit test to use embed directive instead of os.ReadFile

@clement0010 clement0010 requested a review from Copilot August 22, 2025 03:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ReadFile calls with embedded variables in e2e and http_proxy tests
  • Adds new embedded variables for server certificates in the test/data package
  • Removes unnecessary os package 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.

Comment thread internal/httpproxy/http_proxy_test.go Outdated
Comment thread internal/httpproxy/http_proxy_test.go Outdated
Comment thread internal/httpproxy/http_proxy_test.go Outdated
Comment thread internal/httpproxy/http_proxy_test.go Outdated
Comment thread internal/httpproxy/http_proxy_test.go Outdated
Copy link
Copy Markdown
Contributor

@minhtule minhtule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@clement0010 clement0010 merged commit 71f168e into master Aug 22, 2025
12 checks passed
@clement0010 clement0010 deleted the chore/use-embed-directive-everywhere branch August 22, 2025 10:01
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants