Skip to content

Commit

Permalink
Improving naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
tecarter94 committed Jul 11, 2024
1 parent b0d7696 commit 520e6ef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,25 +76,25 @@ 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
- name: Archive Report
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
Expand Down Expand Up @@ -133,13 +133,13 @@ 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
- name: Archive Report
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
29 changes: 15 additions & 14 deletions openshift-with-appstudio-test/e2e/basictests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{})
Expand All @@ -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{})
Expand All @@ -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))
}
})
}
Expand Down

0 comments on commit 520e6ef

Please sign in to comment.