Skip to content

Commit 676150a

Browse files
author
sivakami
committed
Set pipeline params and paths for yaml templates.
1 parent 1e6baf5 commit 676150a

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ stages:
156156
steps:
157157
- checkout: self
158158

159-
- task: AzureCLI@2
160-
displayName: "Run datapath_tests.sh to create PN, PNI, and pods"
159+
- task: GoTool@0
160+
displayName: "Use Go 1.22"
161161
inputs:
162-
azureSubscription: ${{ parameters.serviceConnection }}
163-
scriptType: bash
164-
scriptLocation: scriptPath
165-
scriptPath: ".pipelines/swiftv2-long-running/scripts/datapath_tests.sh"
166-
arguments: >
167-
${{ parameters.resourceGroupName }}
168-
$(Build.BuildId)
162+
version: "1.22"
163+
164+
- script: |
165+
echo "==> Installing Ginkgo CLI"
166+
go install github.com/onsi/ginkgo/v2/[email protected]
167+
echo "==> Running datapath tests"
168+
export RG=${{ parameters.resourceGroupName }}
169+
export BUILD_ID=$(Build.BuildId)
170+
cd test/integration/swiftv2/long_running_cluster
171+
ginkgo -v -trace -fail-fast datapath-test.go
172+
displayName: "Run Ginkgo Datapath Suite"

test/integration/swiftv2/long_running_cluster/datapath-test.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package long_running_cluster
22

33
import (
44
"fmt"
5+
"os"
56
"testing"
67

78
"github.com/onsi/ginkgo/v2"
@@ -16,11 +17,14 @@ func TestDatapath(t *testing.T) {
1617
}
1718

1819
var _ = ginkgo.Describe("Datapath Tests", func() {
19-
RG := "siglin-143139088-westus2"
20-
BUILD_ID := "001"
20+
RG := os.Getenv("RG")
21+
BUILD_ID := os.Getenv("BUILD_ID")
22+
23+
if RG == "" || BUILD_ID == "" {
24+
ginkgo.Fail(fmt.Sprintf("Missing required environment variables: RG='%s', BUILD_ID='%s'", RG, BUILD_ID))
25+
}
2126
CLUSTER2 := "aks-2"
2227
KUBECONFIG2 := fmt.Sprintf("/tmp/%s.kubeconfig", CLUSTER2)
23-
2428
PN_NAME := fmt.Sprintf("pn-%s-c2", BUILD_ID)
2529
PNI_NAME := fmt.Sprintf("pni-%s-c2", BUILD_ID)
2630

@@ -39,7 +43,7 @@ var _ = ginkgo.Describe("Datapath Tests", func() {
3943
SubnetGUID: subnetGUID,
4044
SubnetARMID: subnetARMID,
4145
SubnetToken: subnetToken,
42-
}, "./templates/podnetwork.yaml.tmpl")
46+
}, "../../manifests/swiftv2/long-running-cluster/podnetwork.yaml")
4347
Expect(err).To(BeNil())
4448
})
4549

@@ -50,7 +54,7 @@ var _ = ginkgo.Describe("Datapath Tests", func() {
5054
Namespace: PN_NAME, // namespace same as PN
5155
Type: "explicit",
5256
Reservations: 2,
53-
}, "./templates/podnetworkinstance.yaml.tmpl")
57+
}, "../../manifests/swiftv2/long-running-cluster/podnetworkinstance.yaml")
5458
Expect(err).To(BeNil())
5559
})
5660

@@ -67,7 +71,7 @@ var _ = ginkgo.Describe("Datapath Tests", func() {
6771
PNName: PN_NAME,
6872
PNIName: PNI_NAME,
6973
Image: "weibeld/ubuntu-networking",
70-
}, "./templates/pod.yaml.tmpl")
74+
}, "../../manifests/swiftv2/long-running-cluster/pod.yaml")
7175
Expect(err).To(BeNil())
7276
}
7377
})

0 commit comments

Comments
 (0)