Skip to content

Commit

Permalink
Merge pull request #953 from Azure/use-gh-run-id
Browse files Browse the repository at this point in the history
Use Job ID
  • Loading branch information
janboll authored Dec 10, 2024
2 parents 3aa3b4e + b0b54cf commit dc385bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
check-latest: true

- name: 'Test'
run: PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make test
run: JOB_ID=${{ github.job }} PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make test

lint:
permissions:
Expand Down
16 changes: 9 additions & 7 deletions tooling/templatize/internal/end2end/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,17 @@ func newE2E(tmpdir string) e2eImpl {
}

func (e *e2eImpl) UseRandomRG() func() error {

rgSuffx := ""
if jobID := os.Getenv("JOB_ID"); jobID != "" {
rgSuffx = jobID
}
chars := []rune("abcdefghijklmnopqrstuvwxyz0123456789")
rg := "templatize-e2e-"

for i := 0; i < 10; i++ {
rg += string(chars[rand.IntN(len(chars))])
for i := 0; i < 3; i++ {
rgSuffx += string(chars[rand.IntN(len(chars))])
}
e.rgName = rg
e.SetConfig(config.Variables{"defaults": config.Variables{"rg": rg}})

e.rgName = "templatize-e2e-" + rgSuffx
e.SetConfig(config.Variables{"defaults": config.Variables{"rg": e.rgName}})

return func() error {
subsriptionID, err := pipeline.LookupSubscriptionID(context.Background(), "ARO Hosted Control Planes (EA Subscription 1)")
Expand Down

0 comments on commit dc385bb

Please sign in to comment.