fix(jmx): Parse MBean names using parser, not RegExp (fixes #1952) #5306
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Test | |
| on: | |
| pull_request_target: | |
| branches: | |
| - main | |
| - 2.x | |
| - 1.x | |
| paths-ignore: | |
| - '**.md' | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - edited | |
| push: | |
| branches: | |
| - main | |
| - 2.x | |
| - 1.x | |
| paths-ignore: | |
| - '**.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| permissions: | |
| pull-requests: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # node: ['20', '22'] | |
| # java: ['17', '21'] | |
| node: ['22'] | |
| java: ['17'] | |
| runtime: ['springboot', 'quarkus'] | |
| browser: ['firefox'] # 'chrome' tests are unstable: https://github.com/hawtio/hawtio-next/issues/478 | |
| env: | |
| REPORT_DIR: results-${{matrix.runtime}}-node(${{matrix.node}})-java(${{matrix.java}})-${{matrix.browser}} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| if: ${{ github.event_name == 'pull_request_target' }} | |
| with: | |
| ref: 'refs/pull/${{ github.event.number }}/merge' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| if: ${{ github.event_name == 'push' }} | |
| - name: Docker Setup QEMU | |
| uses: docker/setup-qemu-action@v3.7.0 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v5 | |
| id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
| with: | |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install | |
| run: yarn install | |
| - name: Build | |
| run: yarn build:all | |
| - name: Determine Hawtio branch | |
| id: determine-hawtio-branch | |
| run: | | |
| # Map hawtio-next branch to corresponding hawtio/hawtio branch | |
| current_branch="${{ github.base_ref || github.ref_name }}" | |
| case "$current_branch" in | |
| 2.x) | |
| hawtio_branch="5.x" | |
| ;; | |
| *) | |
| hawtio_branch="4.x" | |
| ;; | |
| esac | |
| echo "HAWTIO_BRANCH=$hawtio_branch" >> $GITHUB_ENV | |
| echo "Using hawtio branch: $hawtio_branch and for hawtio-next branch: $current_branch" | |
| - name: Start server | |
| run: | | |
| DISABLE_WS=true yarn start:app --no-color --no-hot --no-live-reload --no-client-overlay 2>&1 > log & | |
| # Check both CRACO and Webpack log messages until we migrate to Webpack | |
| # https://github.com/hawtio/hawtio-next/pull/847 | |
| timeout 360 bash -c "while ! grep -e 'Project is running at' -e 'webpack .\+ compiled' log ; do cat log; sleep 5; done" | |
| - name: Detect testsuite branch | |
| id: get-images | |
| env: | |
| body: ${{ github.event.pull_request.body || ''}} | |
| run: | | |
| if [[ "${body}" =~ branch:[[:space:]]([[:alnum:]\/_.-]+)(:([[:alnum:]\/_.-]+))? ]]; then | |
| if [ -z "${BASH_REMATCH[2]}" ]; then | |
| echo "repo=hawtio/hawtio" >> $GITHUB_OUTPUT | |
| echo "branch=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT | |
| else | |
| echo "repo=${BASH_REMATCH[1]}/hawtio" >> $GITHUB_OUTPUT | |
| echo "branch=${BASH_REMATCH[3]}" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| branch="${HAWTIO_BRANCH}" | |
| app_image=quay.io/hawtio/hawtio-${{ matrix.runtime }}-test-app:$branch-${{ matrix.java }} | |
| testsuite_image=quay.io/hawtio/hawtio-test-suite:$branch-${{ matrix.java }} | |
| docker pull $app_image | |
| docker pull $testsuite_image | |
| echo "app-image=$app_image" >> $GITHUB_ENV | |
| echo "testsuite-image=$testsuite_image" >> $GITHUB_ENV | |
| fi | |
| - name: Checkout Hawtio | |
| if: ${{ steps.get-images.outputs.repo != ''}} | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ steps.get-images.outputs.repo }} | |
| ref: ${{ steps.get-images.outputs.branch }} | |
| path: hawtio | |
| - name: Set up Java | |
| if: ${{ steps.get-images.outputs.repo != ''}} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{matrix.java}} | |
| cache: 'maven' | |
| - name: Build Hawtio | |
| if: ${{ steps.get-images.outputs.repo != ''}} | |
| run: | | |
| cd hawtio | |
| mvn --batch-mode --no-transfer-progress install -DskipTests -Pe2e -Pdocker-testsuite -Ptests-docker -Dhawtio-container -pl :hawtio-test-suite,:hawtio-tests-quarkus,:hawtio-tests-springboot -am | |
| echo 'app-image=hawtio-${{ matrix.runtime }}-app:${{ matrix.java }}' >> $GITHUB_ENV | |
| echo 'testsuite-image=hawtio-test-suite:${{ matrix.java }}' >> $GITHUB_ENV | |
| - name: Setup application | |
| run: | | |
| case ${{ matrix.runtime }} in | |
| quarkus) | |
| APP_PORT=8080 | |
| echo "url-suffix=hawtio" >> $GITHUB_ENV | |
| echo 'app-port=8080' >> $GITHUB_ENV | |
| ;; | |
| springboot) | |
| APP_PORT=10001 | |
| echo "url-suffix=actuator" >> $GITHUB_ENV | |
| echo 'app-port=10001' >> $GITHUB_ENV | |
| ;; | |
| esac | |
| id=$(docker run --name app --network host -d ${{ env.app-image }}) | |
| timeout 30 bash -c "while ! docker logs $id 2>&1 | grep -q 'Hello Camel!'; do sleep 1; done" | |
| - name: Run tests | |
| run: | | |
| mkdir -p $PWD/$REPORT_DIR/ | |
| docker run --rm --network host \ | |
| -v $PWD/$REPORT_DIR:/workspace/tests/hawtio-test-suite/target \ | |
| -v $PWD/$REPORT_DIR/build:/workspace/tests/hawtio-test-suite/build/ \ | |
| --shm-size="2g" \ | |
| ${{ env.testsuite-image }} -Pe2e-${{ matrix.runtime }} -Dselenide.browser=${{ matrix.browser }} \ | |
| -Dio.hawt.test.url=http://localhost:3000/hawtio \ | |
| -Dio.hawt.test.app.connect.url=http://localhost:${{ env.app-port }}/${{ env.url-suffix }}/jolokia \ | |
| -Dhawtio-next-ci | |
| - name: Prepare container logs | |
| if: always() | |
| run: | | |
| mkdir -p results/$REPORT_DIR/ | |
| docker logs app 2>&1 > results/$REPORT_DIR/container.log | |
| docker logs app 2>&1 > $REPORT_DIR/container.log | |
| echo "Container log:" | |
| cat results/$REPORT_DIR/container.log | |
| - name: Archive test artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: 'test-${{ env.REPORT_DIR }}' | |
| path: | | |
| ${{ env.REPORT_DIR }}/build/reports/tests/*.png | |
| ${{ env.REPORT_DIR }}/*.log | |
| ${{ env.REPORT_DIR }}/cucumber-reports/* | |
| publish-results: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: always() | |
| permissions: | |
| checks: write | |
| actions: read | |
| pull-requests: write | |
| steps: | |
| - name: Determine Hawtio branch | |
| id: determine-hawtio-branch | |
| run: | | |
| # Map hawtio-next branch to corresponding hawtio/hawtio branch | |
| current_branch="${{ github.base_ref || github.ref_name }}" | |
| case "$current_branch" in | |
| 2.x) | |
| hawtio_branch="5.x" | |
| ;; | |
| *) | |
| hawtio_branch="4.x" | |
| ;; | |
| esac | |
| echo "HAWTIO_BRANCH=$hawtio_branch" >> $GITHUB_ENV | |
| echo "Using hawtio branch: $hawtio_branch for hawtio-next branch: $current_branch" | |
| - name: Archive failed test reports | |
| uses: actions/upload-artifact/merge@v4 | |
| if: always() | |
| with: | |
| name: 'test-results' | |
| pattern: test-results-* | |
| separate-directories: true | |
| - name: Download Test Results | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| name: 'test-results' | |
| path: 'test-results' | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: | | |
| **/Cucumber.xml | |
| json_file: results.json | |
| - name: Install xmllint | |
| run: sudo apt-get install -y xmlstarlet jq | |
| - name: Generate summary | |
| run: | | |
| export CHECK_URL=$(jq -r .check_url results.json) | |
| wget https://raw.githubusercontent.com/hawtio/hawtio/${{ env.HAWTIO_BRANCH }}/tests/hawtio-test-suite/process_test_results.sh | |
| wget https://raw.githubusercontent.com/hawtio/hawtio/${{ env.HAWTIO_BRANCH }}/tests/hawtio-test-suite/pr_results_template.xsl | |
| bash process_test_results.sh test-results > summary.md | |
| - name: Update summary | |
| run: | | |
| cat summary.md >> $GITHUB_STEP_SUMMARY | |
| - uses: tibdex/github-app-token@v2 | |
| if: github.event_name == 'pull_request_target' | |
| id: generate-token | |
| with: | |
| app_id: ${{ secrets.HAWTIO_CI_APP_ID }} | |
| private_key: ${{ secrets.HAWTIO_CI_PRIVATE_KEY }} | |
| - name: Comment PR with summary | |
| if: github.event_name == 'pull_request_target' | |
| uses: thollander/actions-comment-pull-request@v3 | |
| with: | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| file-path: summary.md | |
| comment-tag: execution |