-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andre Kurait <[email protected]>
- Loading branch information
1 parent
fcd1218
commit 635d671
Showing
1 changed file
with
127 additions
and
127 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,8 @@ jobs: | |
matrix: | ||
py-project: | ||
- lib/console_link | ||
- cluster_tools | ||
- console_api | ||
# - cluster_tools | ||
# - console_api | ||
env: | ||
WORKING_DIR: ./TrafficCapture/dockerSolution/src/main/docker/migrationConsole/${{ matrix.py-project }} | ||
defaults: | ||
|
@@ -99,120 +99,120 @@ jobs: | |
path: ${{ env.WORKING_DIR }}/coverage.xml | ||
|
||
|
||
gradle-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ env.java-version }} | ||
distribution: 'corretto' | ||
- uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-version: ${{ env.gradle-version }} | ||
gradle-home-cache-cleanup: true | ||
- name: Run Gradle Build | ||
run: ./gradlew build -x test -x TrafficCapture:dockerSolution:build -x spotlessCheck --stacktrace | ||
env: | ||
OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: '' | ||
# gradle-tests: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/setup-java@v4 | ||
# with: | ||
# java-version: ${{ env.java-version }} | ||
# distribution: 'corretto' | ||
# - uses: gradle/actions/setup-gradle@v4 | ||
# with: | ||
# gradle-version: ${{ env.gradle-version }} | ||
# gradle-home-cache-cleanup: true | ||
# - name: Run Gradle Build | ||
# run: ./gradlew build -x test -x TrafficCapture:dockerSolution:build -x spotlessCheck --stacktrace | ||
# env: | ||
# OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: '' | ||
|
||
- name: Run Tests with Coverage | ||
run: ./gradlew mergeJacocoReports -x TrafficCapture:dockerSolution:build -x spotlessCheck --stacktrace | ||
env: | ||
OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: '' | ||
# - name: Run Tests with Coverage | ||
# run: ./gradlew mergeJacocoReports -x TrafficCapture:dockerSolution:build -x spotlessCheck --stacktrace | ||
# env: | ||
# OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: '' | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: test-reports-gradle-tests | ||
path: | | ||
**/build/reports/tests/ | ||
**/reports/jacoco/mergedReport/ | ||
- name: Upload Coverage Reports | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: coverage-reports-gradle-tests | ||
path: ./**/jacocoMergedReport.xml | ||
# - uses: actions/upload-artifact@v4 | ||
# if: always() | ||
# with: | ||
# name: test-reports-gradle-tests | ||
# path: | | ||
# **/build/reports/tests/ | ||
# **/reports/jacoco/mergedReport/ | ||
# - name: Upload Coverage Reports | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# if-no-files-found: error | ||
# name: coverage-reports-gradle-tests | ||
# path: ./**/jacocoMergedReport.xml | ||
|
||
|
||
python-e2e-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ env.java-version }} | ||
distribution: 'corretto' | ||
- uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-version: ${{ env.gradle-version }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.python-version }} | ||
- name: Generate Cache Key from Dockerfiles | ||
id: generate_cache_key | ||
run: | | ||
files=$(find . -type f \( -name 'docker-compose.yml' -o -name 'Dockerfile' \)) | ||
file_contents=$(cat $files) | ||
key=$(echo "${file_contents}" | sha1sum | awk '{print $1}') | ||
echo "key=${key}" >> "$GITHUB_OUTPUT" | ||
- name: Cache Docker Images | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ steps.generate_cache_key.outputs.key }} | ||
- name: Start Docker Solution | ||
run: ./gradlew -p TrafficCapture dockerSolution:ComposeUp -x test -x spotlessCheck --info --stacktrace | ||
env: | ||
OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: '' | ||
- name: Run E2E test script | ||
working-directory: TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/integ_test | ||
run: | | ||
docker exec $(docker ps --filter "name=migration-console" -q) pipenv run pytest /root/lib/integ_test/integ_test/replayer_tests.py --unique_id="testindex" -s | ||
- name: Collect Docker, OpenSearch Benchmark, and Shared Logs | ||
if: always() | ||
run: | | ||
mkdir -p logs/docker logs/opensearch_benchmark_logs logs/shared_logs_output | ||
for container in $(docker ps -aq); do | ||
container_name=$(docker inspect --format '{{.Name}}' $container | sed 's/\///') | ||
docker logs $container > logs/docker/${container_name}_logs.txt 2>&1 | ||
done | ||
docker cp $(docker ps --filter "name=migration-console" -q):/root/.benchmark/logs logs/opensearch_benchmark_logs | ||
docker cp $(docker ps --filter "name=migration-console" -q):/shared-logs-output logs/shared_logs_output | ||
- name: Upload Logs | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: e2e-test-logs | ||
path: | | ||
logs/docker | ||
logs/opensearch_benchmark_logs | ||
logs/shared_logs_output | ||
- name: Clean up migrations docker images before caching | ||
run: | | ||
docker stop $(docker ps -q) && docker system prune --volumes -f | ||
docker image ls --format '{{.Repository}}:{{.Tag}}' | grep '^migrations/' | xargs -I {} docker image rm {} | ||
# python-e2e-tests: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/setup-java@v4 | ||
# with: | ||
# java-version: ${{ env.java-version }} | ||
# distribution: 'corretto' | ||
# - uses: gradle/actions/setup-gradle@v4 | ||
# with: | ||
# gradle-version: ${{ env.gradle-version }} | ||
# - uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: ${{ env.python-version }} | ||
# - name: Generate Cache Key from Dockerfiles | ||
# id: generate_cache_key | ||
# run: | | ||
# files=$(find . -type f \( -name 'docker-compose.yml' -o -name 'Dockerfile' \)) | ||
# file_contents=$(cat $files) | ||
# key=$(echo "${file_contents}" | sha1sum | awk '{print $1}') | ||
# echo "key=${key}" >> "$GITHUB_OUTPUT" | ||
# - name: Cache Docker Images | ||
# uses: ScribeMD/[email protected] | ||
# with: | ||
# key: docker-${{ runner.os }}-${{ steps.generate_cache_key.outputs.key }} | ||
# - name: Start Docker Solution | ||
# run: ./gradlew -p TrafficCapture dockerSolution:ComposeUp -x test -x spotlessCheck --info --stacktrace | ||
# env: | ||
# OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: '' | ||
# - name: Run E2E test script | ||
# working-directory: TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/integ_test | ||
# run: | | ||
# docker exec $(docker ps --filter "name=migration-console" -q) pipenv run pytest /root/lib/integ_test/integ_test/replayer_tests.py --unique_id="testindex" -s | ||
# - name: Collect Docker, OpenSearch Benchmark, and Shared Logs | ||
# if: always() | ||
# run: | | ||
# mkdir -p logs/docker logs/opensearch_benchmark_logs logs/shared_logs_output | ||
# for container in $(docker ps -aq); do | ||
# container_name=$(docker inspect --format '{{.Name}}' $container | sed 's/\///') | ||
# docker logs $container > logs/docker/${container_name}_logs.txt 2>&1 | ||
# done | ||
# docker cp $(docker ps --filter "name=migration-console" -q):/root/.benchmark/logs logs/opensearch_benchmark_logs | ||
# docker cp $(docker ps --filter "name=migration-console" -q):/shared-logs-output logs/shared_logs_output | ||
# - name: Upload Logs | ||
# if: always() | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: e2e-test-logs | ||
# path: | | ||
# logs/docker | ||
# logs/opensearch_benchmark_logs | ||
# logs/shared_logs_output | ||
# - name: Clean up migrations docker images before caching | ||
# run: | | ||
# 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 | ||
defaults: | ||
run: | ||
working-directory: ${{ matrix.npm-project }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node-version }} | ||
- 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 | ||
# defaults: | ||
# run: | ||
# working-directory: ${{ matrix.npm-project }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: ${{ env.node-version }} | ||
# - 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 | ||
|
@@ -240,9 +240,9 @@ jobs: | |
- console-python-tests | ||
- workflow-info | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
iteration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | ||
# strategy: | ||
# matrix: | ||
# iteration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | ||
steps: | ||
- name: Download Workflow Info | ||
uses: actions/download-artifact@v4 | ||
|
@@ -262,28 +262,28 @@ jobs: | |
path: ./coverage-reports | ||
pattern: coverage-reports-* | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v5 | ||
uses: codecov/codecov-action@v5.0.5 | ||
with: | ||
fail_ci_if_error: true | ||
files: /**/coverage-reports/**/*.* | ||
flags: unittests | ||
override_branch: ${{ env.workflow-info_branch }} | ||
override_commit: ${{ env.workflow-info_commit }} | ||
override_pr: ${{ env.workflow-info_pr_number }} | ||
commit_parent: ${{ env.workflow-info_commit_parent }} | ||
override_build_url: ${{ env.workflow-info_build_url }} | ||
override_build: ${{ env.workflow-info_build }} | ||
# override_branch: ${{ env.workflow-info_branch }} | ||
# override_commit: ${{ env.workflow-info_commit }} | ||
# override_pr: ${{ env.workflow-info_pr_number }} | ||
# commit_parent: ${{ env.workflow-info_commit_parent }} | ||
# override_build_url: ${{ env.workflow-info_build_url }} | ||
# override_build: ${{ env.workflow-info_build }} | ||
verbose: true | ||
|
||
all-ci-checks-pass: | ||
needs: | ||
- console-python-tests | ||
- gradle-tests | ||
- link-checker | ||
- node-tests | ||
- python-e2e-tests | ||
- python-lint | ||
- style-check | ||
# - gradle-tests | ||
# - link-checker | ||
# - node-tests | ||
# - python-e2e-tests | ||
# - python-lint | ||
# - style-check | ||
if: always() | ||
runs-on: ubuntu-latest | ||
steps: | ||
|