Increase unit coverage + fix uninstall session cleanup, .sh hover popup, and SCA triage handling(AST-137809) #1391
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: Checkmarx One Jetbrains Plugin CI | |
| on: [ pull_request, workflow_dispatch ] | |
| env: | |
| CX_BASE_URI: ${{ secrets.CX_BASE_URI }} | |
| CX_APIKEY: ${{ secrets.CX_APIKEY }} | |
| CX_TENANT: ${{ secrets.CX_TENANT }} | |
| CX_TEST_REPO: ${{ secrets.CX_TEST_REPO }} | |
| CX_TEST_SCAN: ${{ secrets.CX_TEST_SCAN }} | |
| CX_TEST_BRANCH: ${{ secrets.CX_TEST_BRANCH }} | |
| CX_TEST_PROJECT: ${{ secrets.CX_TEST_PROJECT }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CX_NOT_MATCH_TEST_PROJECT: ${{ secrets.CX_NOT_MATCH_TEST_PROJECT }} | |
| CX_NOT_MATCH_TEST_BRANCH: ${{ secrets.CX_NOT_MATCH_TEST_BRANCH }} | |
| CX_NOT_MATCH_TEST_SCAN_ID: ${{ secrets.CX_NOT_MATCH_TEST_SCAN_ID }} | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| testUI: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Check out current repository | |
| - name: Fetch Sources | |
| uses: actions/checkout@v4 | |
| # Setup Java 11 environment for the next steps | |
| - name: Setup Java | |
| uses: actions/setup-java@v3.13.0 | |
| with: | |
| distribution: zulu | |
| java-version: 11 | |
| - name: Setup FFmpeg | |
| uses: FedericoCarboni/setup-ffmpeg@583042d32dd1cabb8bd09df03bde06080da5c87c #v2.0.0 | |
| with: | |
| # Not strictly necessary, but it may prevent rate limit | |
| # errors especially on GitHub-hosted macos machines. | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # Perform clean before testing | |
| - name: Clean | |
| run: ./gradlew clean | |
| # Run IDEA prepared for UI testing | |
| - name: Run IDE | |
| run: | | |
| mkdir -p build/reports | |
| export DISPLAY=:99.0 | |
| Xvfb -ac :99 -screen 0 1920x1080x24 & | |
| sleep 10 | |
| ./gradlew -i :plugin-checkmarx-ast:runIdeForUiTests > idea.log 2>&1 & | |
| sleep 30 | |
| # Wait for IDEA to be started | |
| - name: Health Check | |
| run: curl --fail -sv --retry "15" --retry-delay "10" --retry-connrefused "http://127.0.0.1:8580" | |
| # Run tests | |
| - name: Tests | |
| run: | | |
| export DISPLAY=:99.0 | |
| ./gradlew :plugin-checkmarx-ast:test -PuiWaitDuration=800 --info --tests "com.checkmarx.intellij.ast.test.ui*" | |
| - name: Move video | |
| if: ${{ failure() }} | |
| run: mv video build/reports | |
| # Save report if tests fail | |
| - name: Save fails report | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-fails-report | |
| path: | | |
| build/reports | |
| # Save idea log if tests fail | |
| - name: Save idea log | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: idea.log | |
| path: | | |
| idea.log | |
| testUnit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Check out current repository | |
| - name: Fetch Sources | |
| uses: actions/checkout@v4 | |
| # Setup Java 11 environment for the next steps | |
| - name: Setup Java | |
| uses: actions/setup-java@v3.13.0 | |
| with: | |
| distribution: zulu | |
| java-version: 11 | |
| # Perform clean before testing | |
| - name: Clean | |
| run: ./gradlew clean | |
| # Run tests | |
| - name: Run Tests with coverage report | |
| id: test_results | |
| run: | | |
| ./gradlew :plugin-checkmarx-ast:test --tests "com.checkmarx.intellij.ast.test.unit*" \ | |
| :devassist-lib:test --tests "com.checkmarx.intellij.devassist.test*" \ | |
| :plugin-checkmarx-devassist:test --tests "com.checkmarx.intellij.cxdevassist.test*" \ | |
| :plugin-checkmarx-ast:jacocoTestReport \ | |
| :devassist-lib:jacocoTestReport \ | |
| :plugin-checkmarx-devassist:jacocoTestReport \ | |
| -PjacocoTask=unit | |
| - name: Generate JaCoCo Badge | |
| uses: cicirello/jacoco-badge-generator@f33476a5a3fd5a4f77cb5eef2ebe728c1dd5b921 #v2.11.0 | |
| with: | |
| jacoco-csv-file: plugin-checkmarx-ast/build/reports/jacoco/test/jacocoTestReport.csv | |
| # Save coverage report as an artifact | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-coverage-report | |
| path: plugin-checkmarx-ast/build/reports/jacoco/test/html/ | |
| # Save report if tests fail | |
| - name: Save fails report | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-fails-report-unit | |
| path: | | |
| plugin-checkmarx-ast/build/reports/tests | |
| devassist-lib/build/reports/tests | |
| plugin-checkmarx-devassist/build/reports/tests | |
| testIntegration: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Check out current repository | |
| - name: Fetch Sources | |
| uses: actions/checkout@v4 | |
| # Setup Java 11 environment for the next steps | |
| - name: Setup Java | |
| uses: actions/setup-java@v3.13.0 | |
| with: | |
| distribution: zulu | |
| java-version: 11 | |
| # Perform clean before testing | |
| - name: Clean | |
| run: ./gradlew clean | |
| # Run tests | |
| - name: Run Tests with coverage report | |
| id: test_results | |
| run: | | |
| ./gradlew :plugin-checkmarx-ast:test --tests "com.checkmarx.intellij.ast.test.integration.standard*" \ | |
| :plugin-checkmarx-ast:jacocoTestReport \ | |
| -PjacocoTask=integration | |
| - name: Generate JaCoCo Badge | |
| uses: cicirello/jacoco-badge-generator@f33476a5a3fd5a4f77cb5eef2ebe728c1dd5b921 #v2.11.0 | |
| with: | |
| jacoco-csv-file: plugin-checkmarx-ast/build/reports/jacoco/test/jacocoTestReport.csv | |
| # Save coverage report as an artifact | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: integration-coverage-report | |
| path: plugin-checkmarx-ast/build/reports/jacoco/test/html/ | |
| # Save report if tests fail | |
| - name: Save fails report | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-fails-report-integration | |
| path: | | |
| plugin-checkmarx-ast/build/reports/tests |