Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/release_build_infisical_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ permissions:
jobs:
validate-tag-branch:
uses: ./.github/workflows/pre-tag-validation.yml
cli-tests:
uses: ./.github/workflows/run-cli-e2e-tests.yml

# cli-integration-tests:
# name: Run tests before deployment
Expand All @@ -37,6 +39,7 @@ jobs:
# - cli-integration-tests
- goreleaser
- validate-tag-branch
- cli-tests
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -77,6 +80,7 @@ jobs:
runs-on: ubuntu-latest-8-cores
needs:
- validate-tag-branch
- cli-tests
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -152,6 +156,7 @@ jobs:
runs-on: windows-2022
needs:
- validate-tag-branch
- cli-tests
steps:
- uses: actions/checkout@v3
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/run-cli-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CLI E2EE Tests

on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.25.2"
- name: Install dependencies
run: go get .
- name: Build the CLI
run: go build -o infisical-cli
- name: Checkout infisical repo
uses: actions/checkout@v6
with:
repository: infisical/infisical
path: infisical
- name: Test with the Go CLI
run: go test -v -timeout 30m -count=1 github.com/infisical/cli/e2e-tests/...
working-directory: ./e2e
env:
INFISICAL_BACKEND_DIR: ${{ github.workspace }}/infisical/backend
INFISICAL_CLI_EXECUTABLE: ${{ github.workspace }}/infisical-cli
CLI_E2E_DEFAULT_RUN_METHOD: subprocess
13 changes: 7 additions & 6 deletions e2e/packages/infisical/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ func (s *Stack) Up(ctx context.Context) error {
}
waited := dockerCompose.WaitForService(
"backend",
wait.ForListeningPort("4000/tcp").
WithStartupTimeout(120*time.Second),
wait.ForHTTP("/api/status").
WithPort("4000/tcp").
WithStartupTimeout(5*time.Minute),
)
s.dockerCompose = waited
if err := s.dockerCompose.Up(ctx); err != nil {
Expand Down Expand Up @@ -170,7 +171,7 @@ func BackendOptionsFromEnv() BackendOptions {
}
dockerfile, found := os.LookupEnv("INFISICAL_BACKEND_DOCKERFILE")
if !found {
dockerfile = "Dockerfile.dev.fips"
dockerfile = "Dockerfile"
}
return BackendOptions{
BackendDir: backendDir,
Expand Down Expand Up @@ -227,20 +228,20 @@ func WithBackendService(options BackendOptions) StackOption {
}
dockerfile := options.Dockerfile
if dockerfile == "" {
dockerfile = "Dockerfile.dev.fips"
dockerfile = "Dockerfile"
}
s.Project.Services["backend"] = types.ServiceConfig{
Build: &types.BuildConfig{
Context: options.BackendDir,
Dockerfile: dockerfile,
},
Ports: []types.ServicePortConfig{
{Published: "", Target: 4000},
{Published: "4000", Target: 4000},
{Published: "9229", Target: 9229},
},
Environment: types.NewMappingWithEquals([]string{
"NODE_ENV=development",
"ENCRYPTION_KEY=VVHnGZ0w98WLgISK4XSJcagezuG6EWRFTk48KE4Y5Mw=",
"ENCRYPTION_KEY=6c1fe4e407b8911c104518103505b218",
"AUTH_SECRET=5lrMXKKWCVocS/uerPsl7V+TX/aaUaI7iDkgl3tSmLE=",
"DB_CONNECTION_URI=postgres://infisical:infisical@db:5432/infisical",
"REDIS_URL=redis://redis:6379",
Expand Down
4 changes: 2 additions & 2 deletions e2e/relay/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestGateway_RegistersAGateway(t *testing.T) {
t.Cleanup(relayCmd.Stop)
result := WaitForStderr(t, WaitForStderrOptions{
EnsureCmdRunning: &relayCmd,
ExpectedString: "Relay server started successfully",
ExpectedString: "Relay is reachable by Infisical",
})
require.Equal(t, WaitSuccess, result)

Expand Down Expand Up @@ -145,7 +145,7 @@ func TestGateway_RelayGatewayConnectivity(t *testing.T) {
t.Cleanup(relayCmd.Stop)
result := WaitForStderr(t, WaitForStderrOptions{
EnsureCmdRunning: &relayCmd,
ExpectedString: "Relay server started successfully",
ExpectedString: "Relay is reachable by Infisical",
})
require.Equal(t, WaitSuccess, result)

Expand Down