@@ -14,12 +14,12 @@ import (
14
14
"github.com/redhat-appstudio/e2e-tests/pkg/utils"
15
15
)
16
16
17
- var stacksPath string
17
+ var samplesFile string
18
18
var namespace string
19
19
20
20
func init () {
21
21
rand .Seed (time .Now ().UnixNano ())
22
- flag .StringVar (& stacksPath , "stacksPath " , "../../extraDevfileEntries.yaml" , "Parent stack file" )
22
+ flag .StringVar (& samplesFile , "samplesFile " , "../../extraDevfileEntries.yaml" , "Parent stack file" )
23
23
flag .StringVar (& namespace , "namespace" , "" , "Namespace where create and build stack samples" )
24
24
}
25
25
@@ -30,19 +30,19 @@ func TestRhtap(t *testing.T) {
30
30
31
31
}
32
32
33
- var _ = Describe ("RHTAP parent stacks checks" , Ordered , Label ("nightly" ), func () {
33
+ var _ = Describe ("RHTAP sample checks" , Ordered , Label ("nightly" ), func () {
34
34
var fw * testHub.ControllerHub
35
35
var testNamespace string
36
36
component := & appservice.Component {}
37
37
cdq := & appservice.ComponentDetectionQuery {}
38
38
39
- stacks , err := LoadTestGeneratorConfig ( stacksPath )
39
+ entries , err := LoadExtraDevfileEntries ( samplesFile )
40
40
Expect (err ).NotTo (HaveOccurred ())
41
41
42
- for _ , stack := range stacks .Samples {
43
- stack := stack
42
+ for _ , sampleEntry := range entries .Samples {
43
+ sampleEntry := sampleEntry
44
44
45
- Describe (stack .Name , func () {
45
+ Describe (sampleEntry .Name , func () {
46
46
BeforeAll (func () {
47
47
kubeClient , err := e2eKube .NewAdminKubernetesClient ()
48
48
Expect (err ).NotTo (HaveOccurred ())
@@ -68,29 +68,29 @@ var _ = Describe("RHTAP parent stacks checks", Ordered, Label("nightly"), func()
68
68
// Create an application in a specific namespace
69
69
It ("creates an application" , func () {
70
70
GinkgoWriter .Printf ("Parallel process %d\n " , GinkgoParallelProcess ())
71
- createdApplication , err := fw .HasController .CreateApplication (stack .Name , testNamespace )
71
+ createdApplication , err := fw .HasController .CreateApplication (sampleEntry .Name , testNamespace )
72
72
Expect (err ).NotTo (HaveOccurred ())
73
73
Expect (createdApplication .Namespace ).To (Equal (testNamespace ))
74
74
})
75
75
76
76
// Check the application health and check if a devfile was generated in the status
77
77
It ("checks if application is healthy" , func () {
78
78
Eventually (func () string {
79
- application , err := fw .HasController .GetApplication (stack .Name , testNamespace )
79
+ application , err := fw .HasController .GetApplication (sampleEntry .Name , testNamespace )
80
80
Expect (err ).NotTo (HaveOccurred ())
81
81
82
82
return application .Status .Devfile
83
83
}, 3 * time .Minute , 100 * time .Millisecond ).Should (Not (BeEmpty ()), "Error creating gitOps repository" )
84
84
})
85
85
86
86
It ("creates componentdetectionquery" , func () {
87
- cdq , err = fw .HasController .CreateComponentDetectionQuery (stack .Name , testNamespace , stack .Git .Remotes .Origin , "" , "" , "" , false )
87
+ cdq , err = fw .HasController .CreateComponentDetectionQuery (sampleEntry .Name , testNamespace , sampleEntry .Git .Remotes .Origin , "" , "" , "" , false )
88
88
Expect (err ).NotTo (HaveOccurred ())
89
89
})
90
90
91
91
It ("creates component" , func () {
92
92
for _ , compDetected := range cdq .Status .ComponentDetected {
93
- component , err = fw .HasController .CreateComponent (compDetected .ComponentStub , testNamespace , "" , "" , stack .Name , true , map [string ]string {})
93
+ component , err = fw .HasController .CreateComponent (compDetected .ComponentStub , testNamespace , "" , "" , sampleEntry .Name , true , map [string ]string {})
94
94
Expect (err ).NotTo (HaveOccurred ())
95
95
}
96
96
})
0 commit comments