Skip to content

ZXF: Extended Test Suite - Dry Run #99

ZXF: Extended Test Suite - Dry Run

ZXF: Extended Test Suite - Dry Run #99

##
# Copyright (C) 2023-2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
name: "ZXF: Extended Test Suite - Dry Run"
on:
workflow_dispatch:
inputs:
commit_sha:
required: true
description: 'The commit sha to check out'
branch_name:
required: true
description: 'The branch name, for JRS Panel output'
permissions:
id-token: write
actions: write
pull-requests: write
statuses: write
checks: write
contents: read
defaults:
run:
shell: bash
jobs:
extended-test-suite:
name: Execute eXtended Test Suite
uses: ./.github/workflows/node-zxc-compile-application-code.yaml
with:
custom-job-label: Execute eXtended Test Suite
enable-timing-sensitive-tests: true
enable-time-consuming-tests: true
enable-hammer-tests: true
enable-hapi-tests-time-consuming: true
enable-network-log-capture: true
ref: ${{ inputs.commit_sha }}
secrets:
access-token: ${{ secrets.GITHUB_TOKEN }}
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
publish-unit-tests-to-codacy:
name: Publish Unit Tests Results to Codacy (commit merged by PR and XTS)
runs-on: network-node-linux-medium
needs: extended-test-suite
if: ${{ needs.extended-test-suite.result == 'success' }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
#ref: develop
ref: 16729-citr-phase-1-aggregate-unit-test-logs
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Find the latest build application workflow run ID # Which was started by a push to develop branch event
id: find-build-application-workflow-id
env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: |
LATEST_BUILD_APPLICATION_RUN_ID=$(gh run list --workflow node-flow-build-application.yaml --branch develop --event push --limit 1 | grep -o '[0-9]\{10,\}')
echo "latest-build-application-run-id=${LATEST_BUILD_APPLICATION_RUN_ID}" >> $GITHUB_OUTPUT
- name: Pull in unit test artifact from build application workflow
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: "test_coverage_report(build_application)"
#run-id: ${{ steps.find-build-application-workflow-id.outputs.latest-build-application-run-id }}
run-id: 12370168122
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
path: build_app_artifact
- name: Pull in XTS Unit Test artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: "test_coverage_report(XTS)"
path: xts_artifact
- name: Combine results in one jacoco report
run: python3 .github/scripts/aggregate_jacoco_reports.py
- name: Publish to Codacy
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: combinedCodeCoverageReport.xml
# - name: Upload Combined Unit Test Results artifact
# uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
# with:
# name: Build app and XTS aggregated Unit tests
# path: |
# build_app_artifacts/*
# xts_artifacts/*
# # find . -path '*/build/test-results/timingSensitive/*' -name 'TEST-*.xml' | tr '\n' ','
# - name: Resolve coverage file paths
# id: coverage_paths
# run: |
# echo "$(find . -path '*/build/test-results/test/*' -name 'TEST-*.xml')" > files.txt
# - name: Publish to Codacy
# env:
# CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# run: |
# while IFS= read -r line; do
# echo "Processing report: $report"
# source <(curl -Ls https://coverage.codacy.com/get.sh) report -l Java -r $line --partial || true
# done < files.txt
# source <(curl -Ls https://coverage.codacy.com/get.sh) final
# COVERAGE_REPORTS="${{ env.COVERAGE_REPORTS }}"
# IFS=','
# for report in $COVERAGE_REPORTS; do
# echo "Processing report: $report"
# source <(curl -Ls https://coverage.codacy.com/get.sh) report -l Java -r $report --partial
# done
# unset IFS
# source <(curl -Ls https://coverage.codacy.com/get.sh) final
# - name: Publish to Codacy
# env:
# CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# run: |
# COVERAGE_REPORTS="${{ env.COVERAGE_REPORTS }}"
# IFS=','
# for report in $COVERAGE_REPORTS; do
# echo "Processing report: $report"
# source <(curl -Ls https://coverage.codacy.com/get.sh) report -l Java -r $report --partial
# done
# unset IFS
# source <(curl -Ls https://coverage.codacy.com/get.sh) final
# - name: Publish to codacy
# uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0
# with:
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# coverage-reports: "downloaded_artifacts/**/TEST-*.xml"
# language: Java
# coverage-reports: '*/build/test-results/test/TEST-*.xml'
# abbreviated-panel:
# name: JRS Panel
# uses: ./.github/workflows/zxc-jrs-regression.yaml
# with:
# custom-job-name: "Platform SDK"
# panel-config: "configs/suites/GCP-PRCheck-Abbrev-4N.json"
# ref: ${{ inputs.commit_sha }}
# branch-name: ${{ inputs.branch_name }}
# base-branch-name: ${{ inputs.branch_name }}
# slack-results-channel: "regression-test"
# slack-summary-channel: "regression-test"
# use-branch-for-slack-channel: false
# secrets:
# access-token: ${{ secrets.PLATFORM_GH_ACCESS_TOKEN }}
# gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
# gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
# jrs-ssh-user-name: ${{ secrets.PLATFORM_JRS_SSH_USER_NAME }}
# jrs-ssh-key-file: ${{ secrets.PLATFORM_JRS_SSH_KEY_FILE }}
# gcp-project-number: ${{ secrets.PLATFORM_GCP_PROJECT_NUMBER }}
# gcp-sa-key-contents: ${{ secrets.PLATFORM_GCP_KEY_FILE }}
# slack-api-token: ${{ secrets.PLATFORM_SLACK_API_TOKEN }}
# grafana-agent-username: ${{ secrets.GRAFANA_AGENT_USERNAME }}
# grafana-agent-password: ${{ secrets.GRAFANA_AGENT_PASSWORD }}
# hedera-node-jrs-panel:
# name: Hedera Node JRS Panel
# uses: ./.github/workflows/zxc-jrs-regression.yaml
# with:
# custom-job-name: "Abbrev Update Test"
# ref: ${{ inputs.commit_sha }}
# branch-name: ${{ inputs.branch_name }}
# hedera-tests-enabled: true
# use-branch-for-slack-channel: false
# panel-config: "configs/services/suites/daily/GCP-Daily-Services-Abbrev-DAB-Update-4N-2C.json"
# secrets:
# access-token: ${{ secrets.PLATFORM_GH_ACCESS_TOKEN }}
# jrs-ssh-user-name: ${{ secrets.PLATFORM_JRS_SSH_USER_NAME }}
# jrs-ssh-key-file: ${{ secrets.PLATFORM_JRS_SSH_KEY_FILE }}
# gcp-project-number: ${{ secrets.PLATFORM_GCP_PROJECT_NUMBER }}
# gcp-sa-key-contents: ${{ secrets.PLATFORM_GCP_KEY_FILE }}
# slack-api-token: ${{ secrets.PLATFORM_SLACK_API_TOKEN }}
# gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
# gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
# grafana-agent-username: ${{ secrets.GRAFANA_AGENT_USERNAME }}
# grafana-agent-password: ${{ secrets.GRAFANA_AGENT_PASSWORD }}