diff --git a/.github/workflows/minikube.yaml b/.github/workflows/minikube.yaml index 4287d6a08..be849adfb 100644 --- a/.github/workflows/minikube.yaml +++ b/.github/workflows/minikube.yaml @@ -27,17 +27,17 @@ jobs: fi exit 0 done - run-gav-based-tests: + run-ab-based-tests: strategy: fail-fast: false matrix: - testsets: + abtestsets: - "test-repos" - "build-systems" - "commons" needs: [wait-for-images] runs-on: ubuntu-latest - name: Minikube GAV Matrix + name: Minikube Artifact Build Matrix steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 @@ -76,7 +76,7 @@ jobs: docker tag quay.io/redhat-appstudio/pull-request-builds:jvmcache-${{ github.event.pull_request.head.sha }} quay.io/minikube/hacbs-jvm-cache:dev docker tag quay.io/redhat-appstudio/pull-request-builds:jvmcontroller-${{ github.event.pull_request.head.sha }} quay.io/minikube/hacbs-jvm-controller:dev - export TESTSET=${{ matrix.testsets }} + export ABTESTSET=${{ matrix.abtestsets }} ./deploy/minikube-ci.sh make minikube-test @@ -84,17 +84,17 @@ jobs: uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 if: always() with: - name: matrix-report-${{ matrix.testsets }} + name: matrix-report-${{ matrix.abtestsets }} path: /tmp/jvm-build-service-report - run-configmap-based-tests: + run-db-based-tests: strategy: fail-fast: false matrix: - cfgmaptestsets: + dbtestsets: - "jakartaee" needs: [wait-for-images] runs-on: ubuntu-latest - name: Minikube Config Map Matrix + name: Minikube Dependency Build Matrix steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 @@ -133,7 +133,7 @@ jobs: docker tag quay.io/redhat-appstudio/pull-request-builds:jvmcache-${{ github.event.pull_request.head.sha }} quay.io/minikube/hacbs-jvm-cache:dev docker tag quay.io/redhat-appstudio/pull-request-builds:jvmcontroller-${{ github.event.pull_request.head.sha }} quay.io/minikube/hacbs-jvm-controller:dev - export CFGMAPTESTSET=${{ matrix.cfgmaptestsets }} + export DBTESTSET=${{ matrix.dbtestsets }} ./deploy/minikube-ci.sh make minikube-test @@ -141,5 +141,5 @@ jobs: uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 if: always() with: - name: matrix-report-${{ matrix.cfgmaptestsets }} + name: matrix-report-${{ matrix.dbtestsets }} path: /tmp/jvm-build-service-report diff --git a/openshift-with-appstudio-test/e2e/basictests.go b/openshift-with-appstudio-test/e2e/basictests.go index 1b6e0a95b..7ecb15b40 100644 --- a/openshift-with-appstudio-test/e2e/basictests.go +++ b/openshift-with-appstudio-test/e2e/basictests.go @@ -48,16 +48,17 @@ func runPipelineTests(t *testing.T, doSetup func(t *testing.T, namespace string) } ta.Logf(fmt.Sprintf("current working dir: %s", path)) - testSet := os.Getenv("CFGMAPTESTSET") - // run config map dependency build tests instead if env var is set + testSet := os.Getenv("DBTESTSET") + // run dependency build tests instead if env var is set + // otherwise run artifact build tests instead if len(testSet) > 0 { - runCfgMapTests(path, testSet, ta) + runDbTests(path, testSet, ta) } else { - runGavTests(path, os.Getenv("TESTSET"), pipeline, ta) + runAbTests(path, os.Getenv("ABTESTSET"), pipeline, ta) } } -func runGavTests(path string, testSet string, pipeline string, ta *testArgs) { +func runAbTests(path string, testSet string, pipeline string, ta *testArgs) { var err error runYamlPath := filepath.Join(path, "..", "..", "hack", "examples", pipeline) @@ -556,29 +557,29 @@ func runGavTests(path string, testSet string, pipeline string, ta *testArgs) { }) } -func runCfgMapTests(path string, testSet string, ta *testArgs) { +func runDbTests(path string, testSet string, ta *testArgs) { parts := readTestData(path, testSet, "minikube-cfgmap.yaml", ta) for _, s := range parts { depBuildBytes, err := os.ReadFile(filepath.Clean(filepath.Join(path, s+"-dependencybuild.yaml"))) if err != nil { - debugAndFailTest(ta, fmt.Sprintf("unable to read dependencybuild for %s configmap test: %s", s, err.Error())) + debugAndFailTest(ta, fmt.Sprintf("unable to read dependencybuild for %s test: %s", s, err.Error())) return } db := v1alpha1.DependencyBuild{} err = yaml.Unmarshal(depBuildBytes, &db) if err != nil { - debugAndFailTest(ta, fmt.Sprintf("unable to unmarshal dependencybuild for %s configmap test: %s", s, err.Error())) + debugAndFailTest(ta, fmt.Sprintf("unable to unmarshal dependencybuild for %s test: %s", s, err.Error())) return } buildRecipeBytes, err := os.ReadFile(filepath.Clean(filepath.Join(path, s+"-buildrecipe.yaml"))) if err != nil { - debugAndFailTest(ta, fmt.Sprintf("unable to read buildrecipe for %s configmap test: %s", s, err.Error())) + debugAndFailTest(ta, fmt.Sprintf("unable to read buildrecipe for %s test: %s", s, err.Error())) return } buildRecipe := v1alpha1.BuildRecipe{} err = yaml.Unmarshal(buildRecipeBytes, &buildRecipe) if err != nil { - debugAndFailTest(ta, fmt.Sprintf("unable to unmarshal buildrecipe for %s configmap test: %s", s, err.Error())) + debugAndFailTest(ta, fmt.Sprintf("unable to unmarshal buildrecipe for %s test: %s", s, err.Error())) return } db.Namespace = ta.ns @@ -629,7 +630,7 @@ func runCfgMapTests(path string, testSet string, ta *testArgs) { return } - ta.t.Run(fmt.Sprintf("configmap dependencybuild complete for repo %s", db.Spec.ScmInfo.SCMURL), func(t *testing.T) { + ta.t.Run(fmt.Sprintf("dependencybuild complete for %s", s), func(t *testing.T) { defer GenerateStatusReport(ta.ns, jvmClient, kubeClient, tektonClient) err = wait.PollUntilContextTimeout(context.TODO(), ta.interval, time.Hour, true, func(ctx context.Context) (done bool, err error) { retrievedDb, err := jvmClient.JvmbuildserviceV1alpha1().DependencyBuilds(ta.ns).Get(context.TODO(), db.Name, metav1.GetOptions{}) @@ -651,11 +652,11 @@ func runCfgMapTests(path string, testSet string, ta *testArgs) { return dbComplete, nil }) if err != nil { - debugAndFailTest(ta, fmt.Sprintf("timed out waiting for configmap dependencybuild %s for repo %s to complete", db.Name, db.Spec.ScmInfo.SCMURL)) + debugAndFailTest(ta, fmt.Sprintf("timed out waiting for dependencybuild %s for repo %s to complete", db.Name, db.Spec.ScmInfo.SCMURL)) } }) - ta.t.Run(fmt.Sprintf("configmap dependencybuild for repo %s contains buildrecipe", db.Spec.ScmInfo.SCMURL), func(t *testing.T) { + ta.t.Run(fmt.Sprintf("dependencybuild for %s contains buildrecipe", s), func(t *testing.T) { defer GenerateStatusReport(ta.ns, jvmClient, kubeClient, tektonClient) err = wait.PollUntilContextTimeout(context.TODO(), ta.interval, time.Hour, true, func(ctx context.Context) (done bool, err error) { retrievedDb, err := jvmClient.JvmbuildserviceV1alpha1().DependencyBuilds(ta.ns).Get(context.TODO(), db.Name, metav1.GetOptions{}) @@ -677,7 +678,7 @@ func runCfgMapTests(path string, testSet string, ta *testArgs) { return containsRecipe, nil }) if err != nil { - debugAndFailTest(ta, fmt.Sprintf("timed out waiting for configmap dependencybuild %s for repo %s to be retrieved", db.Name, db.Spec.ScmInfo.SCMURL)) + debugAndFailTest(ta, fmt.Sprintf("timed out waiting for dependencybuild %s for repo %s to be retrieved", db.Name, db.Spec.ScmInfo.SCMURL)) } }) }