From 6bea0b457e7cbdb28dd31525d8df06abb24f2214 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Oct 2023 16:47:33 -0400 Subject: [PATCH] Restore security test to original as it is not good to run dind for docker Signed-off-by: Peter Zhu --- .github/workflows/security-test-workflow.yml | 27 ++++++-------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 44d8c8492..127962210 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -9,13 +9,7 @@ on: - "*" jobs: - Get-CI-Image-Tag: - uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main - with: - product: opensearch - - build-linux: - needs: Get-CI-Image-Tag + build: strategy: matrix: java: [ 11, 17 ] @@ -23,14 +17,12 @@ jobs: name: Build and test Alerting # This job runs on Linux runs-on: ubuntu-latest - container: - # using the same image which is used by opensearch-build team to build the OpenSearch Distribution - # this image tag is subject to change as more dependencies and updates will arrive over time - image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }} - # need to switch to root so that github actions can install runner binary on container without permission issues. - options: --user root - steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} # This step uses the checkout Github action: https://github.com/actions/checkout - name: Checkout Branch uses: actions/checkout@v2 @@ -41,9 +33,7 @@ jobs: java-version: ${{ matrix.java }} - name: Build Alerting # Only assembling since the full build is governed by other workflows - run: | - chown -R opensearch.opensearch `pwd` - su opensearch -c "whoami && java -version && ./gradlew assemble" + run: ./gradlew assemble - name: Pull and Run Docker run: | plugin=`basename $(ls alerting/build/distributions/*.zip)` @@ -96,8 +86,7 @@ jobs: if [ $security -gt 0 ] then echo "Security plugin is available" - chown -R opensearch.opensearch `pwd` - su opensearch -c "whoami && java -version && ./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin" + ./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin else echo "Security plugin is NOT available skipping this run as tests without security have already been run" fi