Skip to content

Commit 77ce6ff

Browse files
perdasilvaPer Goncalves da Silva
and
Per Goncalves da Silva
authored
Fix e2e test grid by using ginkgo labels (#3451)
* Fix e2e gha num chunks Signed-off-by: Per Goncalves da Silva <[email protected]> * Refactor e2e split tool for labels Signed-off-by: Per Goncalves da Silva <[email protected]> * Add ginkgo labels to e2e tests Signed-off-by: Per Goncalves da Silva <[email protected]> --------- Signed-off-by: Per Goncalves da Silva <[email protected]> Co-authored-by: Per Goncalves da Silva <[email protected]>
1 parent 92011d9 commit 77ce6ff

29 files changed

+143
-204
lines changed

Diff for: .github/workflows/e2e-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ jobs:
9292
9393
# run non-flakes if matrix-id is not 'flakes'
9494
- name: Run e2e tests
95-
# calculate the number of chunks as the number of parallel jobs minus 1 (flakes job)
95+
# calculate the number of chunks as the number of parallel jobs
9696
# use the split tool to split the test suite into chunks and run the chunk corresponding to the matrix-id
9797
# focus on those tests and skip tests marked as FLAKE
9898
run: |
99-
E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} - 1 )) \
100-
GINKGO_OPTS="${GINKGO_OPTS} -focus '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \
99+
E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} )) \
100+
GINKGO_OPTS="${GINKGO_OPTS} -label-filter '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \
101101
make e2e;
102102
103103
# archive test results

Diff for: test/e2e/bundle_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
//go:embed testdata/vpa/crd.yaml
2727
var vpaCRDRaw []byte
2828

29-
var _ = Describe("Installing bundles with new object types", func() {
29+
var _ = Describe("Installing bundles with new object types", Label("ObjectTypes"), func() {
3030
var (
3131
kubeClient operatorclient.ClientInterface
3232
operatorClient versioned.Interface

Diff for: test/e2e/catalog_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
badCSVDir = "bad-csv"
4444
)
4545

46-
var _ = Describe("Starting CatalogSource e2e tests", func() {
46+
var _ = Describe("Starting CatalogSource e2e tests", Label("CatalogSource"), func() {
4747
var (
4848
generatedNamespace corev1.Namespace
4949
c operatorclient.ClientInterface

Diff for: test/e2e/catalog_exclusion_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
const magicCatalogDir = "magiccatalog"
2121

22-
var _ = Describe("Global Catalog Exclusion", func() {
22+
var _ = Describe("Global Catalog Exclusion", Label("CatalogExclusion"), func() {
2323
var (
2424
generatedNamespace corev1.Namespace
2525
determinedE2eClient *util.DeterminedE2EClient

Diff for: test/e2e/catsrc_pod_config_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const catalogSourceLabel = "olm.catalogSource"
1818

1919
var _ = By
2020

21-
var _ = Describe("CatalogSource Grpc Pod Config", func() {
21+
var _ = Describe("CatalogSource Grpc Pod Config", Label("CatalogSourcePodConfig"), func() {
2222

2323
var (
2424
generatedNamespace corev1.Namespace

Diff for: test/e2e/crd_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
)
2424

25-
var _ = Describe("CRD Versions", func() {
25+
var _ = Describe("CRD Versions", Label("CRDs"), func() {
2626
var (
2727
generatedNamespace corev1.Namespace
2828
c operatorclient.ClientInterface

Diff for: test/e2e/csv_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
3535
)
3636

37-
var _ = Describe("ClusterServiceVersion", func() {
37+
var _ = Describe("ClusterServiceVersion", Label("ClusterServiceVersion"), func() {
3838
var (
3939
generatedNamespace corev1.Namespace
4040
c operatorclient.ClientInterface

Diff for: test/e2e/deprecated_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
var missingAPI = `{"apiVersion":"verticalpodautoscalers.autoscaling.k8s.io/v1","kind":"VerticalPodAutoscaler","metadata":{"name":"my.thing","namespace":"foo"}}`
2020

21-
var _ = Describe("Not found APIs", func() {
21+
var _ = Describe("Not found APIs", Label("APIDeprecation"), func() {
2222
var generatedNamespace corev1.Namespace
2323

2424
BeforeEach(func() {

Diff for: test/e2e/disabling_copied_csv_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const (
2626
protectedCopiedCSVNamespacesRuntimeFlag = "--protectedCopiedCSVNamespaces"
2727
)
2828

29-
var _ = Describe("Disabling copied CSVs", func() {
29+
var _ = Describe("Disabling copied CSVs", Label("DisablingCopiedCSVs"), func() {
3030
var (
3131
generatedNamespace corev1.Namespace
3232
csv operatorsv1alpha1.ClusterServiceVersion

Diff for: test/e2e/dynamic_resource_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
// This test was disabled because both of its tests are currently being skipped
2121
// We need to understand why and whether this test is even needed:
2222
// https://github.com/operator-framework/operator-lifecycle-manager/issues/3402
23-
var _ = XDescribe("Subscriptions create required objects from Catalogs", func() {
23+
var _ = XDescribe("Subscriptions create required objects from Catalogs", Label("DynamicResource"), func() {
2424
var (
2525
crc versioned.Interface
2626
generatedNamespace corev1.Namespace

Diff for: test/e2e/fail_forward_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func updateCatalogSource(namespace, name string, packages ...string) (func(), er
123123
return deployCatalogSource(namespace, name, packages...)
124124
}
125125

126-
var _ = Describe("Fail Forward Upgrades", func() {
126+
var _ = Describe("Fail Forward Upgrades", Label("FailForward"), func() {
127127

128128
var (
129129
generatedNamespace corev1.Namespace

Diff for: test/e2e/gc_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
2424
)
2525

26-
var _ = Describe("Garbage collection for dependent resources", func() {
26+
var _ = Describe("Garbage collection for dependent resources", Label("GarbageCollection"), func() {
2727
var (
2828
kubeClient operatorclient.ClientInterface
2929
operatorClient versioned.Interface

Diff for: test/e2e/installplan_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const (
5050
deprecatedCRDDir = "deprecated-crd"
5151
)
5252

53-
var _ = Describe("Install Plan", func() {
53+
var _ = Describe("Install Plan", Label("InstallPlan"), func() {
5454
var (
5555
c operatorclient.ClientInterface
5656
crc versioned.Interface

Diff for: test/e2e/magic_catalog_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"sigs.k8s.io/controller-runtime/pkg/client"
1414
)
1515

16-
var _ = Describe("MagicCatalog", func() {
16+
var _ = Describe("MagicCatalog", Label("MagicCatalog"), func() {
1717
var (
1818
generatedNamespace corev1.Namespace
1919
c client.Client

Diff for: test/e2e/metrics_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
2828
)
2929

30-
var _ = Describe("Metrics are generated for OLM managed resources", func() {
30+
var _ = Describe("Metrics are generated for OLM managed resources", Label("Metrics"), func() {
3131
var (
3232
c operatorclient.ClientInterface
3333
crc versioned.Interface

Diff for: test/e2e/operator_condition_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
2020
)
2121

22-
var _ = Describe("Operator Condition", func() {
22+
var _ = Describe("Operator Condition", Label("OperatorCondition"), func() {
2323
var (
2424
generatedNamespace corev1.Namespace
2525
)

Diff for: test/e2e/operator_groups_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
3636
)
3737

38-
var _ = Describe("Operator Group", func() {
38+
var _ = Describe("Operator Group", Label("OperatorGroup"), func() {
3939
var (
4040
c operatorclient.ClientInterface
4141
crc versioned.Interface

Diff for: test/e2e/operator_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
)
3232

3333
// Describes test specs for the Operator resource.
34-
var _ = Describe("Operator API", func() {
34+
var _ = Describe("Operator API", Label("Operator"), func() {
3535
var (
3636
clientCtx context.Context
3737
scheme *runtime.Scheme

Diff for: test/e2e/packagemanifest_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
2424
)
2525

26-
var _ = Describe("Package Manifest API lists available Operators from Catalog Sources", func() {
26+
var _ = Describe("Package Manifest API lists available Operators from Catalog Sources", Label("PackageManifest"), func() {
2727
var (
2828
crc versioned.Interface
2929
pmc pmversioned.Interface

Diff for: test/e2e/resource_manager_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
1515
)
1616

17-
var _ = Describe("ResourceManager", func() {
17+
var _ = Describe("ResourceManager", Label("ResourceManager"), func() {
1818
var generatedNamespace corev1.Namespace
1919

2020
BeforeEach(func() {

Diff for: test/e2e/scoped_client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx"
1919
)
2020

21-
var _ = Describe("Scoped Client bound to a service account can be used to make API calls", func() {
21+
var _ = Describe("Scoped Client bound to a service account can be used to make API calls", Label("ScopedClient"), func() {
2222
// TestScopedClient ensures that we can create a scoped client bound to a
2323
// service account and then we can use the scoped client to make API calls.
2424
var (

Diff for: test/e2e/split/integration_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ function get_total_specs() {
55
}
66

77
unfocused_specs=$(get_total_specs)
8-
regexp=$(go run ./test/e2e/split/... -chunks 1 -print-chunk 0 ./test/e2e)
9-
focused_specs=$(get_total_specs -focus "$regexp")
8+
label_filter=$(go run ./test/e2e/split/... -chunks 1 -print-chunk 0 ./test/e2e)
9+
focused_specs=$(get_total_specs -label-filter "$label_filter")
1010

1111
if ! [ $unfocused_specs -eq $focused_specs ]; then
1212
echo "expected number of unfocused specs $unfocused_specs to equal focus specs $focused_specs"

0 commit comments

Comments
 (0)