This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b865a1  Replace hard coded native test categories with dynamic lookup
8b865a1 is described below

commit 8b865a1e2b41ea3028fb8fe469b2e30a72423704
Author: James Netherton <[email protected]>
AuthorDate: Tue May 5 07:38:34 2020 +0100

    Replace hard coded native test categories with dynamic lookup
---
 .github/test-categories.yaml                       | 189 ++++++++++-----------
 .github/workflows/camel-master-cron.yaml           |  31 ++--
 .github/workflows/ci-build.yaml                    |  31 ++--
 .github/workflows/purge-stale-artifacts-cron.yaml  |   2 +-
 .github/workflows/quarkus-master-cron.yaml         |  31 ++--
 docs/modules/ROOT/pages/promote-jvm-to-native.adoc |   7 +-
 tooling/scripts/validate-github-workflows.groovy   |   2 +-
 7 files changed, 132 insertions(+), 161 deletions(-)

diff --git a/.github/test-categories.yaml b/.github/test-categories.yaml
index 6f50383..4817d04 100644
--- a/.github/test-categories.yaml
+++ b/.github/test-categories.yaml
@@ -16,98 +16,97 @@
 #
 
 # Association of test categories and integration test modules. Used by GitHub 
workflows.
-categories:
-  cloud:
-    - aws
-    - aws2
-    - azure
-    - consul
-    - elasticsearch-rest
-  core:
-    - core
-    - core-impl
-    - core-main
-    - core-main-caffeine-lrucache
-    - core-main-collector
-    - core-main-xml-io
-    - core-main-xml-jaxb
-  database:
-    - couchdb
-    - influxdb
-    - jdbc
-    - kudu
-    - mongodb
-    - sql
-  dataformats:
-    - base64
-    - bindy
-    - csv
-    - dataformat
-    - jaxb
-    - xstream
-    - soap
-  foundation:
-    - bean
-    - controlbus
-    - exec
-    - file
-    - hystrix
-    - jsonpath
-    - quartz
-    - scheduler
-    - seda
-    - send-dynamic-http
-    - ref
-  memoryhog-dataformat-json:
-    - dataformats-json
-  memoryhog-dozer:
-    - dozer
-  memoryhog-infinispan:
-    - infinispan
-  memoryhog-olingo4:
-    - olingo4
-  memoryhog-xml:
-    - rest-binding-mode-xml
-    - xml
-  messaging:
-    - activemq
-    - amqp
-    - kafka
-    - messaging
-  misc:
-    - braintree
-    - compression
-    - graphql
-    - mustache
-    - pdf
-    - qute
-    - stream
-    - tarfile
-  networking:
-    - ftp
-    - http
-    - mail
-    - netty
-    - servlet
-    - websocket-jsr356
-  platform:
-    - microprofile
-    - opentracing
-    - platform-http
-    - platform-http-engine
-    - reactive-streams
-  saas:
-    - box
-    - github
-    - google
-    - jira
-    - salesforce
-    - sap-netweaver
-    - servicenow
-    - slack
-  social:
-    - telegram
-    - twitter
-  validation:
-    - bean-validator
-    - validator
+cloud:
+  - aws
+  - aws2
+  - azure
+  - consul
+  - elasticsearch-rest
+core:
+  - core
+  - core-impl
+  - core-main
+  - core-main-caffeine-lrucache
+  - core-main-collector
+  - core-main-xml-io
+  - core-main-xml-jaxb
+database:
+  - couchdb
+  - influxdb
+  - jdbc
+  - kudu
+  - mongodb
+  - sql
+dataformats:
+  - base64
+  - bindy
+  - csv
+  - dataformat
+  - jaxb
+  - xstream
+  - soap
+foundation:
+  - bean
+  - controlbus
+  - exec
+  - file
+  - hystrix
+  - jsonpath
+  - quartz
+  - scheduler
+  - seda
+  - send-dynamic-http
+  - ref
+memoryhog-dataformat-json:
+  - dataformats-json
+memoryhog-dozer:
+  - dozer
+memoryhog-infinispan:
+  - infinispan
+memoryhog-olingo4:
+  - olingo4
+memoryhog-xml:
+  - rest-binding-mode-xml
+  - xml
+messaging:
+  - activemq
+  - amqp
+  - kafka
+  - messaging
+misc:
+  - braintree
+  - compression
+  - graphql
+  - mustache
+  - pdf
+  - qute
+  - stream
+  - tarfile
+networking:
+  - ftp
+  - http
+  - mail
+  - netty
+  - servlet
+  - websocket-jsr356
+platform:
+  - microprofile
+  - opentracing
+  - platform-http
+  - platform-http-engine
+  - reactive-streams
+saas:
+  - box
+  - github
+  - google
+  - jira
+  - salesforce
+  - sap-netweaver
+  - servicenow
+  - slack
+social:
+  - telegram
+  - twitter
+validation:
+  - bean-validator
+  - validator
diff --git a/.github/workflows/camel-master-cron.yaml 
b/.github/workflows/camel-master-cron.yaml
index 6692177..2d18983 100644
--- a/.github/workflows/camel-master-cron.yaml
+++ b/.github/workflows/camel-master-cron.yaml
@@ -31,6 +31,8 @@ jobs:
     runs-on: ubuntu-latest
     env:
       MAVEN_OPTS: -Xmx3000m
+    outputs:
+      matrix: ${{ steps.set-native-matrix.outputs.matrix }}
     steps:
       - name: Clean VM
         run: |
@@ -74,6 +76,13 @@ jobs:
         with:
           name: maven-repo
           path: maven-repo.tgz
+      - name: Setup Native Test Matrix
+        id: set-native-matrix
+        run: |
+          sudo wget -O /usr/local/bin/yq 
"https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64";
+          sudo chmod +x /usr/local/bin/yq
+          CATEGORIES=$(cat .github/test-categories.yaml | yq r - --printMode p 
"*." | sed "s/\(.*\)/'\1'/" | sed ':a;N;$!ba;s/\n/,/g')
+          echo "::set-output name=matrix::{'category': [${CATEGORIES}]}"
       - name: Report Build Failure
         if: failure()
         run: |
@@ -90,25 +99,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
-      matrix:
-        category: 
-          - core
-          - foundation
-          - platform
-          - messaging
-          - database
-          - dataformats
-          - networking
-          - cloud
-          - misc
-          - saas
-          - social
-          - validation
-          - memoryhog-dozer
-          - memoryhog-dataformat-json
-          - memoryhog-infinispan
-          - memoryhog-olingo4
-          - memoryhog-xml
+      matrix: ${{ fromJson(needs.build.outputs.matrix) }}
     steps:
       - name: Download Maven Repo
         uses: actions/download-artifact@v1
@@ -140,7 +131,7 @@ jobs:
       - name: Integration Tests
         run: |
           TEST_MODULES=""
-          for MODULE in $(cat .github/test-categories.yaml | yq r - 
categories.${{ matrix.category }}); do
+          for MODULE in $(cat .github/test-categories.yaml | yq r - "${{ 
matrix.category }}.*"); do
             if [ "${MODULE}" == "-" ]; then
               continue
             fi
diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index b76b2b8..3dc4314 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -47,6 +47,8 @@ jobs:
     runs-on: ubuntu-latest
     env:
       MAVEN_OPTS: -Xmx3000m
+    outputs:
+      matrix: ${{ steps.set-native-matrix.outputs.matrix }}
     steps:
       - name: Setup apache-snapshots profile
         if: github.ref == 'refs/heads/camel-master' || github.base_ref == 
'camel-master'
@@ -80,6 +82,13 @@ jobs:
           key: maven-${{ github.run_id }}-${{ github.run_number }}
           restore-keys: |
             maven-${{ github.run_id }}-${{ github.run_number }}
+      - name: Setup Native Test Matrix
+        id: set-native-matrix
+        run: |
+          sudo wget -O /usr/local/bin/yq 
"https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64";
+          sudo chmod +x /usr/local/bin/yq
+          CATEGORIES=$(cat .github/test-categories.yaml | yq r - --printMode p 
"*." | sed "s/\(.*\)/'\1'/" | sed ':a;N;$!ba;s/\n/,/g')
+          echo "::set-output name=matrix::{'category': [${CATEGORIES}]}"
   build-alternative-jvm:
     runs-on: ubuntu-latest
     needs: build
@@ -119,25 +128,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
-      matrix:
-        category: 
-          - core
-          - foundation
-          - platform
-          - messaging
-          - database
-          - dataformats
-          - networking
-          - cloud
-          - misc
-          - saas
-          - social
-          - validation
-          - memoryhog-dozer
-          - memoryhog-dataformat-json
-          - memoryhog-infinispan
-          - memoryhog-olingo4
-          - memoryhog-xml
+      matrix: ${{ fromJson(needs.build.outputs.matrix) }}
     steps:
       - name: Setup apache-snapshots profile
         if: github.ref == 'refs/heads/camel-master' || github.base_ref == 
'camel-master'
@@ -169,7 +160,7 @@ jobs:
           TEST_MODULES: ${{matrix.test-modules}}
         run: |
           TEST_MODULES=""
-          for MODULE in $(cat .github/test-categories.yaml | yq r - 
categories.${{ matrix.category }}); do
+          for MODULE in $(cat .github/test-categories.yaml | yq r - "${{ 
matrix.category }}.*"); do
             if [ "${MODULE}" == "-" ]; then
               continue
             fi
diff --git a/.github/workflows/purge-stale-artifacts-cron.yaml 
b/.github/workflows/purge-stale-artifacts-cron.yaml
index 9e4d7a9..697ebb9 100644
--- a/.github/workflows/purge-stale-artifacts-cron.yaml
+++ b/.github/workflows/purge-stale-artifacts-cron.yaml
@@ -23,7 +23,7 @@ on:
     - cron: '0 */4 * * *'
 
 jobs:
-  pruge-stale-build-artifacts:
+  purge-stale-build-artifacts:
     if: github.repository == 'apache/camel-quarkus'
     runs-on: ubuntu-latest
     steps:
diff --git a/.github/workflows/quarkus-master-cron.yaml 
b/.github/workflows/quarkus-master-cron.yaml
index 77b6309..9a7a25b 100644
--- a/.github/workflows/quarkus-master-cron.yaml
+++ b/.github/workflows/quarkus-master-cron.yaml
@@ -31,6 +31,8 @@ jobs:
     runs-on: ubuntu-latest
     env:
       MAVEN_OPTS: -Xmx3000m
+    outputs:
+      matrix: ${{ steps.set-native-matrix.outputs.matrix }}
     steps:
       - name: Clean VM
         run: |
@@ -80,6 +82,13 @@ jobs:
         with:
           name: maven-repo
           path: maven-repo.tgz
+      - name: Setup Native Test Matrix
+        id: set-native-matrix
+        run: |
+          sudo wget -O /usr/local/bin/yq 
"https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64";
+          sudo chmod +x /usr/local/bin/yq
+          CATEGORIES=$(cat .github/test-categories.yaml | yq r - --printMode p 
"*." | sed "s/\(.*\)/'\1'/" | sed ':a;N;$!ba;s/\n/,/g')
+          echo "::set-output name=matrix::{'category': [${CATEGORIES}]}"
       - name: Report Build Failure
         if: failure()
         run: |
@@ -96,25 +105,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
-      matrix:
-        category: 
-          - core
-          - foundation
-          - platform
-          - messaging
-          - database
-          - dataformats
-          - networking
-          - cloud
-          - misc
-          - saas
-          - social
-          - validation
-          - memoryhog-dozer
-          - memoryhog-dataformat-json
-          - memoryhog-infinispan
-          - memoryhog-olingo4
-          - memoryhog-xml
+      matrix: ${{ fromJson(needs.build.outputs.matrix) }}
     steps:
       - name: Download Maven Repo
         uses: actions/download-artifact@v1
@@ -146,7 +137,7 @@ jobs:
       - name: Integration Tests
         run: |
           TEST_MODULES=""
-          for MODULE in $(cat .github/test-categories.yaml | yq r - 
categories.${{ matrix.category }}); do
+          for MODULE in $(cat .github/test-categories.yaml | yq r - "${{ 
matrix.category }}.*"); do
             if [ "${MODULE}" == "-" ]; then
               continue
             fi
diff --git a/docs/modules/ROOT/pages/promote-jvm-to-native.adoc 
b/docs/modules/ROOT/pages/promote-jvm-to-native.adoc
index a85b0a7..779a3e7 100644
--- a/docs/modules/ROOT/pages/promote-jvm-to-native.adoc
+++ b/docs/modules/ROOT/pages/promote-jvm-to-native.adoc
@@ -97,13 +97,12 @@ $ {
 * Ensure `unlisted` is NOT present
 * Remove the `preview` status
 
-9. Add itests to `.github/test-categories.yaml`, for instance:
+9. Add the integration test to an existing or new test category in 
`.github/test-categories.yaml`, for instance:
 +
 [source,yaml]
 ----
-categories:
-  rpc:
-    - grpc
+rpc:
+  - grpc
 ----
 
 10. Unify source files format, update docs and rebuild the whole project:
diff --git a/tooling/scripts/validate-github-workflows.groovy 
b/tooling/scripts/validate-github-workflows.groovy
index 3c56bf7..4b408de 100644
--- a/tooling/scripts/validate-github-workflows.groovy
+++ b/tooling/scripts/validate-github-workflows.groovy
@@ -35,7 +35,7 @@ final Yaml parser = new Yaml()
 def testCategoryConfig = parser.load((jobDefPath.toFile()).text)
 
 def modules = []
-testCategoryConfig['categories'].each { k, v ->
+testCategoryConfig.each { k, v ->
     v.each {
         modules << it
     }

Reply via email to