Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 71 additions & 79 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
java-version: '17'
gradle-version: '8.12.1'
node-version: '18.x'
gradle-test-parallelization: '30'
gradle-test-parallelization: '5'

# Prevent multiple simultaneous runs except on main repo
concurrency:
Expand Down Expand Up @@ -39,8 +39,8 @@ jobs:
echo '{' > workflow-info.json
echo ' "pr_number": "${{ github.event.pull_request.number }}",' >> workflow-info.json
echo ' "commit": "${{ github.event.pull_request.head.sha || github.event.after || github.sha }}",' >> workflow-info.json
echo ' "branch": "${{ github.ref }}",' >> workflow-info.json
echo ' "commit_parent": "${{ github.event.pull_request.base.sha || github.event.before || github.base.sha }}",' >> workflow-info.json
echo ' "branch": "${{ github.base_ref }}",' >> workflow-info.json
# echo ' "commit_parent": "${{ github.event.pull_request.base.sha || github.event.before || github.base.sha }}",' >> workflow-info.json
echo ' "build_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",' >> workflow-info.json
echo ' "build": "${{ github.run_id }}"' >> workflow-info.json
echo '}' >> workflow-info.json
Expand Down Expand Up @@ -81,41 +81,41 @@ jobs:
run: |
flake8 $(git ls-files '*.py')

python-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py-project:
- migrationConsole/lib/console_link
- migrationConsole/cluster_tools
- k8sConfigMapUtilScripts
env:
WORKING_DIR: ./TrafficCapture/dockerSolution/src/main/docker/${{ matrix.py-project }}
defaults:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-env
- run: |
python3 -m pip install --upgrade pipenv
pipenv install --deploy --dev
pipenv graph
# python-tests:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# py-project:
# - migrationConsole/lib/console_link
# - migrationConsole/cluster_tools
# - k8sConfigMapUtilScripts
# env:
# WORKING_DIR: ./TrafficCapture/dockerSolution/src/main/docker/${{ matrix.py-project }}
# defaults:
# run:
# working-directory: ${{ env.WORKING_DIR }}
# steps:
# - uses: actions/checkout@v5
# - uses: ./.github/actions/setup-env
# - run: |
# python3 -m pip install --upgrade pipenv
# pipenv install --deploy --dev
# pipenv graph

- run: |
pipenv run test
pipenv run coverage xml
- name: Get Sanitized Name
env:
PY_PROJECT: ${{ matrix.py-project }}
run: echo "SANITIZED_PY_PROJECT=${PY_PROJECT//\//-}" >> $GITHUB_ENV
- name: Upload Coverage Reports
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: coverage-reports-python-tests-${{ env.SANITIZED_PY_PROJECT }}
path: ${{ env.WORKING_DIR }}/coverage.xml
# - run: |
# pipenv run test
# pipenv run coverage xml
# - name: Get Sanitized Name
# env:
# PY_PROJECT: ${{ matrix.py-project }}
# run: echo "SANITIZED_PY_PROJECT=${PY_PROJECT//\//-}" >> $GITHUB_ENV
# - name: Upload Coverage Reports
# uses: actions/upload-artifact@v4
# with:
# if-no-files-found: error
# name: coverage-reports-python-tests-${{ env.SANITIZED_PY_PROJECT }}
# path: ${{ env.WORKING_DIR }}/coverage.xml

generate-test-matrix:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Run Gradle tests with striping
run: |
MAX_WORKERS=$(( $(nproc) - 1 ))
gradle allTests \
gradle nonIsolatedTests \
--max-workers $MAX_WORKERS \
-Dtest.striping.total=${{ env.gradle-test-parallelization }} \
-Dtest.striping.index=${{ matrix.index }} \
Expand Down Expand Up @@ -184,14 +184,14 @@ jobs:
path: |
**/build/reports/tests/

- name: Publish Jacoco report artifact for stripe ${{ matrix.index }}
- name: Upload Codecov report artifact for stripe ${{ matrix.index }}
if: always()
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: coverage-exec-artifacts-gradle-tests-stripe-${{ matrix.index }}
name: coverage-report-artifacts-gradle-tests-stripe-${{ matrix.index }}
path: |
**/build/jacoco/*.exec
**/lcov.info

- name: Show disk usage
if: always()
Expand All @@ -203,29 +203,21 @@ jobs:
needs: [ gradle-tests ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-env
- name: Create clean .exec directory
run: rm -rf build/jacocoMerged && mkdir -p build/jacocoMerged

- name: Download all JaCoCo .exec files into directory expected by jacocoAggregateReport
- name: Download all codecov reports
uses: actions/download-artifact@v5
with:
path: build/jacocoMerged
pattern: coverage-exec-artifacts-gradle-tests-*
merge-multiple: true

- name: Generate aggregate JaCoCo report
run: gradle jacocoAggregateReport --stacktrace
path: reports
pattern: coverage-report-artifacts-gradle-tests-*
merge-multiple: false

- name: Upload Aggregate JaCoCo report
- name: Upload Coverate Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
if-no-files-found: error
name: coverage-reports-gradle-tests-aggregate
path: |
build/reports/jacoco/mergedReport/*
reports/*

python-e2e-tests:
needs: [ generate-cache-key ]
Expand Down Expand Up @@ -276,25 +268,25 @@ jobs:
docker stop $(docker ps -q) && docker system prune --volumes -f
docker image ls --format '{{.Repository}}:{{.Tag}}' | grep '^migrations/' | xargs -I {} docker image rm {}

node-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
npm-project:
- ./deployment/cdk/opensearch-service-migration
- ./deployment/migration-assistant-solution
- ./frontend
defaults:
run:
working-directory: ${{ matrix.npm-project }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-env
- name: Install NPM dependencies
run: npm ci
- name: Run CDK Jest Tests (using mocked images)
run: npm run test
# node-tests:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# npm-project:
# - ./deployment/cdk/opensearch-service-migration
# - ./deployment/migration-assistant-solution
# - ./frontend
# defaults:
# run:
# working-directory: ${{ matrix.npm-project }}
# steps:
# - uses: actions/checkout@v5
# - uses: ./.github/actions/setup-env
# - name: Install NPM dependencies
# run: npm ci
# - name: Run CDK Jest Tests (using mocked images)
# run: npm run test

link-checker:
runs-on: ubuntu-latest
Expand All @@ -320,13 +312,13 @@ jobs:

all-ci-checks-pass:
needs:
- python-tests
# - python-tests
- gradle-tests
- jacoco-aggregate
- link-checker
- node-tests
- python-e2e-tests
- python-lint
# - link-checker
# - node-tests
# - python-e2e-tests
# - python-lint
- gradle-extended-check
if: always()
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jenkins_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches-ignore:
- 'backport/**'
- 'dependabot/**'
pull_request_target:
types: [opened, synchronize, reopened]
# pull_request_target:
# types: [opened, synchronize, reopened]

env:
python-version: '3.11'
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ gradle.projectsEvaluated {
previousTask = task as Task
}

tasks.register("nonIsolatedTests") {
dependsOn sharedProcessTestsTasks
}

tasks.register("allTests") {
dependsOn sharedProcessTestsTasks
dependsOn isolatedTestsTasks
Expand Down