Skip to content

Commit eebd7a6

Browse files
author
Josef Karasek
committed
move invalid manifests to e2e dir
Signed-off-by: Josef Karasek <jkarasek@redhat.com>
1 parent 9997177 commit eebd7a6

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

test/e2e/opm_test.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ var (
3232
channels = "preview"
3333
defaultChannel = "preview"
3434

35-
bundlePath1 = "manifests/prometheus/0.14.0"
36-
bundlePath2 = "manifests/prometheus/0.15.0"
37-
bundlePath3 = "manifests/prometheus/0.22.2"
38-
invalidBundlePath1 = "manifests/invalid-manifests/prometheus/0.22.2"
35+
bundlePath1 = "manifests/prometheus/0.14.0"
36+
bundlePath2 = "manifests/prometheus/0.15.0"
37+
bundlePath3 = "manifests/prometheus/0.22.2"
3938

4039
bundleTag1 = rand.String(6)
4140
bundleTag2 = rand.String(6)
@@ -69,12 +68,12 @@ func (bl bundleLocations) images() []string {
6968
return images
7069
}
7170

72-
func inTemporaryBuildContext(f func() error) (rerr error) {
71+
func inTemporaryBuildContext(f func() error, source string) (rerr error) {
7372
td, err := ioutil.TempDir(".", "opm-")
7473
if err != nil {
7574
return err
7675
}
77-
err = copy.Copy("../../manifests", filepath.Join(td, "manifests"))
76+
err = copy.Copy(source, filepath.Join(td, "manifests"))
7877
if err != nil {
7978
return err
8079
}
@@ -219,19 +218,19 @@ func initialize() error {
219218

220219
var _ = Describe("opm", func() {
221220
IncludeSharedSpecs := func(containerTool string) {
222-
Describe("builds and validates a bundle image", func() {
221+
FDescribe("builds and validates a bundle image", func() {
223222
var (
224-
path string
225223
img string
226224
unpackDir string
225+
sourceDir string
227226
validator bundle.BundleImageValidator
228227
)
229228

230229
JustBeforeEach(func() {
231230
By("building bundle")
232231
err := inTemporaryBuildContext(func() error {
233-
return bundle.BuildFunc(path, "", img, containerTool, packageName, channels, defaultChannel, false)
234-
})
232+
return bundle.BuildFunc(bundlePath3, "", img, containerTool, packageName, channels, defaultChannel, false)
233+
}, sourceDir)
235234
Expect(err).NotTo(HaveOccurred())
236235

237236
By("pushing bundle")
@@ -259,8 +258,8 @@ var _ = Describe("opm", func() {
259258

260259
When("the image is valid", func() {
261260
BeforeEach(func() {
262-
path = bundlePath3
263261
img = bundleImage + ":" + bundleTag3
262+
sourceDir = "../../manifests"
264263
})
265264
It("should succeed", func() {
266265
Expect(validator.ValidateBundleFormat(unpackDir)).To(Succeed())
@@ -272,8 +271,8 @@ var _ = Describe("opm", func() {
272271

273272
When("the image is NOT valid", func() {
274273
BeforeEach(func() {
275-
path = invalidBundlePath1
276274
img = bundleImage + ":" + rand.String(6)
275+
sourceDir = "../../test/e2e/testdata/invalid-manifests"
277276
})
278277
It("should fail", func() {
279278
Expect(validator.ValidateBundleFormat(unpackDir)).To(Succeed())
@@ -296,7 +295,7 @@ var _ = Describe("opm", func() {
296295
for _, b := range bundles {
297296
err = inTemporaryBuildContext(func() error {
298297
return bundle.BuildFunc(b.path, "", b.image, containerTool, packageName, channels, defaultChannel, false)
299-
})
298+
}, "../../manifests")
300299
Expect(err).NotTo(HaveOccurred())
301300
}
302301

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)