forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
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
dc7fe94
commit 95aaf9b
Showing
1 changed file
with
93 additions
and
93 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 |
---|---|---|
|
@@ -99,99 +99,99 @@ 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: '' | ||
|
||
- 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 | ||
# 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: '' | ||
# | ||
# - 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 | ||
|
@@ -239,10 +239,10 @@ jobs: | |
all-ci-checks-pass: | ||
needs: | ||
- console-python-tests | ||
- gradle-tests | ||
# - gradle-tests | ||
- link-checker | ||
- node-tests | ||
- python-e2e-tests | ||
# - python-e2e-tests | ||
# Temp disable linting from blocking | ||
# - python-lint | ||
- style-check | ||
|