diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8cd1e00..0839c561 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,50 +9,31 @@ on: jobs: Get-CI-Image-Tag: - runs-on: ubuntu-latest - outputs: - ci-image-version-linux: ${{ steps.step-ci-image-version-linux.outputs.ci-image-version-linux }} - steps: - - name: Install crane - uses: iarekylew00t/crane-installer@v1 - with: - crane-release: v0.15.2 - - name: Checkout opensearch-build repository - uses: actions/checkout@v3 - with: - repository: 'opensearch-project/opensearch-build' - ref: 'main' - path: 'opensearch-build' - - name: Get ci image version from opensearch-build repository scripts - id: step-ci-image-version-linux - run: | - crane version - CI_IMAGE_VERSION=`opensearch-build/docker/ci/get-ci-images.sh -p centos7 -u opensearch -t build | head -1` - echo $CI_IMAGE_VERSION - echo "ci-image-version-linux=$CI_IMAGE_VERSION" >> $GITHUB_OUTPUT + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main + with: + product: opensearch build-linux: needs: Get-CI-Image-Tag strategy: matrix: java: [21] - env: - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true name: Build and Test skills plugin 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 + options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }} steps: + - name: Run start commands + run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }} - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: temurin @@ -64,7 +45,7 @@ jobs: ./gradlew publishToMavenLocal" - name: Upload Coverage Report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -79,9 +60,9 @@ jobs: steps: - name: Checkout skills - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: temurin @@ -103,10 +84,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: temurin @@ -120,7 +101,7 @@ jobs: ./gradlew publishToMavenLocal - name: Upload Coverage Report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/test/java/org/opensearch/integTest/BaseAgentToolsIT.java b/src/test/java/org/opensearch/integTest/BaseAgentToolsIT.java index fa73d4fe..b83b05c0 100644 --- a/src/test/java/org/opensearch/integTest/BaseAgentToolsIT.java +++ b/src/test/java/org/opensearch/integTest/BaseAgentToolsIT.java @@ -49,6 +49,7 @@ import lombok.SneakyThrows; + public abstract class BaseAgentToolsIT extends OpenSearchSecureRestTestCase { public static final Gson gson = new Gson(); private static final int MAX_TASK_RESULT_QUERY_TIME_IN_SECOND = 60 * 5; @@ -90,8 +91,10 @@ protected void updateClusterSettings(String settingKey, Object value) { @SneakyThrows private Map parseResponseToMap(Response response) { + String responseBody= EntityUtils.toString(response.getEntity()); + logger.info("responseBody: {}", responseBody); Map responseInMap = XContentHelper - .convertToMap(XContentType.JSON.xContent(), EntityUtils.toString(response.getEntity()), false); + .convertToMap(XContentType.JSON.xContent(), responseBody, false); return responseInMap; }