Skip to content

Conversation

@fangpenlin
Copy link
Contributor

@fangpenlin fangpenlin commented Dec 16, 2025

Description 📣

ref: https://linear.app/infisical/issue/PLATFRM-125/update-the-current-poc-with-design-doc-feedbacks

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

To run the tests, first, you need to set the path pointing to the infisical repo's backend folder as INFISICAL_BACKEND_DIR (keep in mind, you need to have feature flags set correctly, we will fix that in the future, but for now it needs to be done manually). For example:

export INFISICAL_BACKEND_DIR=/Users/fangpenlin/workspace/infisical/backend

next, the e2e test by default runs the executable as a subprocess, we need a path t
o the executable of CLI:

INFISICAL_CLI_EXECUTABLE=/Users/fangpenlin/works
pace/cli/infisical-merge

With these, you can then cd into the e2e folder and run the test like this

cd e2e
go test github.com/infisical/cli/e2e-tests/relay

or, you can run the above in just one line:

INFISICAL_BACKEND_DIR=/Users/fangpenlin/workspace/infisical/backend INFISICAL_CLI_EXECUTABLE=/Users/fangpenlin/works
pace/cli/infisical-merge go test github.com/infisical/cli/e2e-tests/rela

To make it possible to trace into the CLI code with a debugger, we also provide functionCall as an alt way to run the CLI main function. By doing so, you don't need INFISICAL_CLI_EXECUTABLE set. Instead, you need CLI_E2E_DEFAULT_RUN_METHOD=functionCall:

export CLI_E2E_DEFAULT_RUN_METHOD=functionCall

Or, you can run it with one line:

INFISICAL_BACKEND_DIR=/Users/fangpenlin/workspace/infisical/backend CLI_E2E_DEFAULT_RUN_METHOD=functionCall go test github.com/infisical/cli/e2e-tests/relay

@gitguardian
Copy link

gitguardian bot commented Dec 16, 2025

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9387833 Triggered Generic Password 50ab9f6 e2e/packages/infisical/compose.go View secret
8529478 Triggered Generic High Entropy Secret 50ab9f6 e2e/packages/infisical/compose.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@fangpenlin fangpenlin force-pushed the PLATFRM-125-e2e-test-poc branch from 7e8e11c to 8af2351 Compare December 16, 2025 19:03
@fangpenlin fangpenlin marked this pull request as ready for review December 17, 2025 19:26
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 17, 2025

Greptile Summary

  • Introduces comprehensive end-to-end testing infrastructure for Infisical CLI with Docker Compose orchestration, automated client code generation, and relay functionality testing
  • Modifies CLI command execution pattern to support better testing by returning errors instead of calling os.Exit(1) and adding context-aware execution
  • Adds automated OpenAPI client generation with endpoint filtering for focused E2E testing using oapi-codegen and proper Makefile automation

Important Files Changed

Filename Overview
e2e/relay/relay_test.go New comprehensive E2E test validating relay registration and heartbeat communication with proper Docker environment setup
main.go Updated main function to properly handle command errors and exit with status code 1 on failures
packages/relay/relay.go Added graceful shutdown handling with net.ErrClosed checks to support clean relay termination in tests
e2e/packages/client/provisioner.go New provisioner for bootstrapping test environments with admin accounts and tokens; contains error message bug on line 83
e2e/compose.yaml Docker Compose configuration using hardcoded credentials suitable for testing but lacking health checks

Confidence score: 4/5

  • This PR implements a well-structured E2E testing framework with comprehensive Docker orchestration and proper abstraction layers
  • Score reflects one bug found in error handling (wrong variable in error message) and some security considerations around hardcoded test credentials
  • Pay close attention to e2e/packages/client/provisioner.go line 83 where the error message uses wrong response variable

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

16 files reviewed, 7 comments

Edit Code Review Agent Settings | Greptile

@fangpenlin fangpenlin force-pushed the PLATFRM-125-e2e-test-poc branch 2 times, most recently from 8061ede to 44280ae Compare January 6, 2026 02:49
add db

xxx

Use yaml struct instead, add backend

Add env vars

wrong img

Map volume

built in marshall

Fix volume

Generate client

Add makefile

Add compose helper

More helper

More helper

Use new helper

Remove unused stuff

get mapped port

Get port and host

Add provisioner

Add more helpers

Fix provisioning

xxx

Simple test

Fix cookies not passed in issue

Refine code

Extract helper

use helper

Map to a random port instead

Cleanup

Add machine identity & token

Register id

Update identity to allow token auth

Set default up timeout to 120 instead

Add operation id

Update deps

Test relay start

Set temp dir as home

Fix api url

Allow private ip

Try to add relays

Get relays

Add logs

Add TODO

Extract method

Fix tests

Fix asserts

Fix assert

Address feedbacks

Add execute context
@fangpenlin fangpenlin force-pushed the PLATFRM-125-e2e-test-poc branch from d6f09f0 to 7fa0723 Compare January 6, 2026 19:56
@fangpenlin fangpenlin merged commit 0f2c127 into main Jan 7, 2026
3 checks passed
@fangpenlin fangpenlin deleted the PLATFRM-125-e2e-test-poc branch January 7, 2026 17:29
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