@@ -37,14 +37,23 @@ import (
37
37
)
38
38
39
39
var _ = Describe ("[sig-olmv1][OCPFeatureGate:NewOLM][Skipped:Disconnected] OLMv1 operator installation" , func () {
40
+ var unique , nsName , ccName , rbName , opName string
40
41
BeforeEach (func () {
41
42
helpers .RequireOLMv1CapabilityOnOpenshift ()
43
+ unique = rand .String (8 )
44
+ nsName = "install-test-ns-" + unique
45
+ ccName = "install-test-cc-" + unique
46
+ rbName = "install-test-rb-" + unique
47
+ opName = "install-test-op-" + unique
48
+ })
49
+
50
+ AfterEach (func (ctx SpecContext ) {
51
+ if CurrentSpecReport ().Failed () {
52
+ By ("dumping for debugging" )
53
+ helpers .DescribeAllClusterCatalogs (context .Background ())
54
+ helpers .DescribeAllClusterExtensions (context .Background (), nsName )
55
+ }
42
56
})
43
- unique := rand .String (8 )
44
- nsName := "install-test-ns-" + unique
45
- ccName := "install-test-cc-" + unique
46
- rbName := "install-test-rb-" + unique
47
- opName := "install-test-op-" + unique
48
57
It ("should block cluster upgrades if an incompatible operator is installed" , func (ctx SpecContext ) {
49
58
if ! env .Get ().IsOpenShift {
50
59
Skip ("Requires OCP APIs: not OpenShift" )
@@ -316,6 +325,15 @@ func waitForBuildToFinish(ctx SpecContext, name, namespace string) {
316
325
g .Expect (cond ).ToNot (BeNil ())
317
326
g .Expect (cond .Status ).To (Equal (corev1 .ConditionTrue ))
318
327
}).WithTimeout (5 * time .Minute ).WithPolling (1 * time .Second ).Should (Succeed ())
328
+
329
+ DeferCleanup (func () {
330
+ if CurrentSpecReport ().Failed () {
331
+ if CurrentSpecReport ().Failed () {
332
+ helpers .RunAndPrint (context .Background (), "get" , "build" , name , "-n" , namespace , "-oyaml" )
333
+ helpers .RunAndPrint (context .Background (), "logs" , fmt .Sprintf ("build/%s" , name ), "-n" , namespace , "--tail=200" )
334
+ }
335
+ }
336
+ })
319
337
}
320
338
321
339
func waitForClusterCatalogServing (ctx context.Context , name string ) {
0 commit comments