Skip to content

Commit 7abe8a4

Browse files
committed
stembuild: specs use timestamp suffix
Replaces the use of a random number or UUID fragment to make it easier to identify stale resources. Use `-` to separate OS verson from IP address suffix in construct specs
1 parent c9241f4 commit 7abe8a4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

ci/tasks/setup-integration-test-vm/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export OUTPUT_DIR=${ROOT_DIR}/output
99
VM_IP=$(cat nimbus-ips/name)
1010
CLONE_NAME_PREFIX="construct-${JOB_OS_NAME}-integration-ci-${OS_LINE}"
1111
CLONE_NAME_SUFFIX=$(echo "${VM_IP}" | cut -d . -f 4)
12-
CLONE_NAME=${CLONE_NAME_PREFIX}${CLONE_NAME_SUFFIX}
12+
CLONE_NAME=${CLONE_NAME_PREFIX}-${CLONE_NAME_SUFFIX}
1313

1414
export VM_IP
1515
export CLONE_NAME_PREFIX

stembuild/iaas_cli/iaas_clients/iaas_clients_suite_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/google/uuid"
1110
. "github.com/onsi/ginkgo/v2"
1211
. "github.com/onsi/gomega"
1312
"github.com/vmware/govmomi/object"
@@ -60,7 +59,7 @@ var _ = BeforeSuite(func() {
6059
vmToClone, err := vCenterManager.FindVM(CTX, testVmPath)
6160
Expect(err).ToNot(HaveOccurred())
6261

63-
TestVmPath = testVmPath + fmt.Sprintf("%s", uuid.New())[0:8] //nolint:staticcheck
62+
TestVmPath = fmt.Sprintf("%s-%s", testVmPath, time.Now().Format("2006-01-02T15h04s05"))
6463

6564
err = vCenterManager.CloneVM(CTX, vmToClone, TestVmPath)
6665
Expect(err).ToNot(HaveOccurred())

stembuild/integration/package/package_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"crypto/sha1"
77
"fmt"
88
"io"
9-
"math/rand"
109
"os"
1110
"path/filepath"
1211
"strings"
@@ -33,7 +32,7 @@ var _ = Describe("Package", func() {
3332

3433
BeforeEach(func() {
3534
vcenterFolder := helpers.EnvMustExist(vcenterFolderVariable)
36-
packageTestVMName := fmt.Sprintf("stembuild-package-test-%d", rand.Int())
35+
packageTestVMName := fmt.Sprintf("stembuild-package-test-%s", time.Now().Format("2006-01-02T15h04s05"))
3736

3837
baseVMWithPath := strings.Join([]string{vcenterFolder, baseVMName}, "/")
3938
vmPath = strings.Join([]string{vcenterFolder, packageTestVMName}, "/")

0 commit comments

Comments
 (0)