Skip to content

Commit 8258aac

Browse files
[no-relnote] Update Github Actions E2E
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 7b0e2ee commit 8258aac

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

.github/workflows/e2e.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jobs:
7070

7171
- name: Run e2e tests
7272
env:
73-
IMAGE_NAME: ghcr.io/nvidia/container-toolkit
74-
VERSION: ${{ inputs.version }}
73+
E2E_IMAGE_REPO: ghcr.io/nvidia/container-toolkit
74+
E2E_IMAGE_TAG: ${{ inputs.version }}-ubuntu20.04
7575
SSH_KEY: ${{ secrets.AWS_SSH_KEY }}
7676
E2E_SSH_USER: ${{ secrets.E2E_SSH_USER }}
7777
E2E_SSH_HOST: ${{ steps.holodeck_public_dns_name.outputs.result }}
@@ -82,8 +82,15 @@ jobs:
8282
chmod 600 "$e2e_ssh_key"
8383
export E2E_SSH_KEY="$e2e_ssh_key"
8484
85-
make -f tests/e2e/Makefile test
85+
make -f tests/e2e/Makefile test-e2e
8686
87+
- name: Archive Ginkgo logs
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: ginkgo-logs
91+
path: ginkgo.json
92+
retention-days: 15
93+
8794
- name: Send Slack alert notification
8895
if: ${{ failure() }}
8996
uses: slackapi/[email protected]

tests/e2e/e2e_test.go

+16-4
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ func getTestEnv() {
111111
sshKey = os.Getenv("SSH_KEY")
112112
Expect(sshKey).NotTo(BeEmpty(), "SSH_KEY environment variable must be set")
113113

114-
sshUser = os.Getenv("SSH_USER")
114+
sshUser = os.Getenv("E2E_SSH_USER")
115115
Expect(sshUser).NotTo(BeEmpty(), "SSH_USER environment variable must be set")
116116

117-
host = os.Getenv("REMOTE_HOST")
117+
host = os.Getenv("E2E_SSH_HOST")
118118
Expect(host).NotTo(BeEmpty(), "REMOTE_HOST environment variable must be set")
119119

120-
sshPort = os.Getenv("REMOTE_PORT")
121-
Expect(sshPort).NotTo(BeEmpty(), "REMOTE_PORT environment variable must be set")
120+
sshPort = getIntEnvVar("E2E_SSH_PORT", 22)
122121

123122
// Get current working directory
124123
cwd, err = os.Getwd()
@@ -137,3 +136,16 @@ func getBoolEnvVar(key string, defaultValue bool) bool {
137136
}
138137
return boolValue
139138
}
139+
140+
// getIntEnvVar returns the integer value of the environment variable or the default value if not set.
141+
func getIntEnvVar(key string, defaultValue int) string {
142+
value := os.Getenv(key)
143+
if value == "" {
144+
return strconv.Itoa(defaultValue)
145+
}
146+
intValue, err := strconv.Atoi(value)
147+
if err != nil {
148+
return strconv.Itoa(defaultValue)
149+
}
150+
return strconv.Itoa(intValue)
151+
}

0 commit comments

Comments
 (0)