From 8258aac64fb49e919ed017cf2f09f604b8a7781e Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Arango Gutierrez Date: Thu, 24 Apr 2025 20:50:18 +0200 Subject: [PATCH] [no-relnote] Update Github Actions E2E Signed-off-by: Carlos Eduardo Arango Gutierrez --- .github/workflows/e2e.yaml | 13 ++++++++++--- tests/e2e/e2e_test.go | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 3a3275de..e1937aaa 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -70,8 +70,8 @@ jobs: - name: Run e2e tests env: - IMAGE_NAME: ghcr.io/nvidia/container-toolkit - VERSION: ${{ inputs.version }} + E2E_IMAGE_REPO: ghcr.io/nvidia/container-toolkit + E2E_IMAGE_TAG: ${{ inputs.version }}-ubuntu20.04 SSH_KEY: ${{ secrets.AWS_SSH_KEY }} E2E_SSH_USER: ${{ secrets.E2E_SSH_USER }} E2E_SSH_HOST: ${{ steps.holodeck_public_dns_name.outputs.result }} @@ -82,8 +82,15 @@ jobs: chmod 600 "$e2e_ssh_key" export E2E_SSH_KEY="$e2e_ssh_key" - make -f tests/e2e/Makefile test + make -f tests/e2e/Makefile test-e2e + - name: Archive Ginkgo logs + uses: actions/upload-artifact@v4 + with: + name: ginkgo-logs + path: ginkgo.json + retention-days: 15 + - name: Send Slack alert notification if: ${{ failure() }} uses: slackapi/slack-github-action@v2.0.0 diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 3d16bf26..03ae7316 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -111,14 +111,13 @@ func getTestEnv() { sshKey = os.Getenv("SSH_KEY") Expect(sshKey).NotTo(BeEmpty(), "SSH_KEY environment variable must be set") - sshUser = os.Getenv("SSH_USER") + sshUser = os.Getenv("E2E_SSH_USER") Expect(sshUser).NotTo(BeEmpty(), "SSH_USER environment variable must be set") - host = os.Getenv("REMOTE_HOST") + host = os.Getenv("E2E_SSH_HOST") Expect(host).NotTo(BeEmpty(), "REMOTE_HOST environment variable must be set") - sshPort = os.Getenv("REMOTE_PORT") - Expect(sshPort).NotTo(BeEmpty(), "REMOTE_PORT environment variable must be set") + sshPort = getIntEnvVar("E2E_SSH_PORT", 22) // Get current working directory cwd, err = os.Getwd() @@ -137,3 +136,16 @@ func getBoolEnvVar(key string, defaultValue bool) bool { } return boolValue } + +// getIntEnvVar returns the integer value of the environment variable or the default value if not set. +func getIntEnvVar(key string, defaultValue int) string { + value := os.Getenv(key) + if value == "" { + return strconv.Itoa(defaultValue) + } + intValue, err := strconv.Atoi(value) + if err != nil { + return strconv.Itoa(defaultValue) + } + return strconv.Itoa(intValue) +}