Skip to content

Commit 5c835fb

Browse files
authored
Add sample version support on rhtap nightly (#257)
Signed-off-by: thepetk <[email protected]>
1 parent b77c7f9 commit 5c835fb

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

tests/rhtap/rhtap_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,14 @@ var _ = Describe("RHTAP sample checks", Ordered, Label("nightly"), func() {
8787
})
8888

8989
It("creates componentdetectionquery", func() {
90-
cdq, err = fw.HasController.CreateComponentDetectionQuery(sampleEntry.Name, testNamespace, sampleEntry.Git.Remotes.Origin, "", "", "", false)
91-
Expect(err).NotTo(HaveOccurred())
90+
for _, sampleEntryVersion := range sampleEntry.Versions {
91+
if sampleEntryVersion.Default {
92+
sampleEntryGit := sampleEntryVersion.Git.Remotes.Origin
93+
cdq, err = fw.HasController.CreateComponentDetectionQuery(sampleEntry.Name, testNamespace, sampleEntryGit, "", "", "", false)
94+
Expect(err).NotTo(HaveOccurred())
95+
break
96+
}
97+
}
9298
})
9399

94100
It("creates component", func() {

tests/rhtap/types.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ type Git struct {
1515
Remotes Remotes `yaml:"remotes"`
1616
}
1717

18+
type Version struct {
19+
Default bool `yaml:"default"`
20+
Git Git `yaml:"git"`
21+
}
22+
1823
type SampleEntry struct {
19-
Name string `yaml:"name"`
20-
DisplayName string `yaml:"displayName"`
21-
Language string `yaml:"language"`
22-
ProjectType string `yaml:"projectType"`
23-
Git Git `yaml:"git"`
24+
Name string `yaml:"name"`
25+
DisplayName string `yaml:"displayName"`
26+
Language string `yaml:"language"`
27+
ProjectType string `yaml:"projectType"`
28+
Versions []Version `yaml:"versions"`
2429
}
2530

2631
type ExtraDevfileEntries struct {

0 commit comments

Comments
 (0)