Skip to content

Commit

Permalink
Rename e2e job names to ci- for consistency
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <[email protected]>
  • Loading branch information
shivakunv committed Dec 19, 2024
1 parent 6783298 commit e352586
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var _ = Describe("AWS", func() {
Expect(err).ToNot(HaveOccurred())

// Set unique name for the environment
opts.cfg.Name = opts.cfg.Name + "-" + common.GenerateUID()
common.SetCfgName(&opts.cfg)
// set cache path
opts.cachePath = LogArtifactDir
// set cache file
Expand Down
21 changes: 20 additions & 1 deletion tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@

package common

import "math/rand"
import (
"fmt"
"math/rand"
"os"

"github.com/NVIDIA/holodeck/api/holodeck/v1alpha1"
)

func GenerateUID() string {
const charset = "abcdefghijklmnopqrstuvwxyz0123456789"
Expand All @@ -28,3 +34,16 @@ func GenerateUID() string {

return string(b)
}

func SetCfgName(cfg *v1alpha1.Environment) {
sha := os.Getenv("GITHUB_SHA")
attempt := os.Getenv("GITHUB_RUN_ATTEMPT")
// short sha
if len(sha) > 8 {
sha = sha[:8]
}
// uid is unique for each run
uid := GenerateUID()

cfg.Name = fmt.Sprintf("ci%s-%s-%s", attempt, sha, uid)
}

0 comments on commit e352586

Please sign in to comment.