From cf73e79abb185aa44e6cdeadb68f83742fc5dc6d Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Thu, 5 Jan 2023 13:36:09 -0800 Subject: [PATCH] Add windows env to integration test workflow Signed-off-by: Tyler Ohlsen --- .../remote-integ-tests-workflow-windows | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/remote-integ-tests-workflow-windows diff --git a/.github/workflows/remote-integ-tests-workflow-windows b/.github/workflows/remote-integ-tests-workflow-windows new file mode 100644 index 00000000..c4edf7a4 --- /dev/null +++ b/.github/workflows/remote-integ-tests-workflow-windows @@ -0,0 +1,115 @@ +# Running AD integ tests stored in https://github.com/opensearch-project/opensearch-dashboards-functional-test +# In the future we should pull dependencies from bundled build snapshots. Because that is not available +# yet we build the cluster from source (besides core Opensearch, which is a pulled min artifact). +name: Remote integ tests workflow +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' +env: + OPENSEARCH_DASHBOARDS_VERSION: 'main' + OPENSEARCH_VERSION: '3.0.0-SNAPSHOT' + OPENSEARCH_DASHBOARDS_FTREPO_VERSION: 'main' + ANOMALY_DETECTION_PLUGIN_VERSION: 'main' +jobs: + test-without-security: + name: Run integ tests without security + strategy: + matrix: + os: [windows-latest] + java: [11] + runs-on: ${{ matrix.os }} + steps: + - name: Enable longer filenames + run: git config --system core.longpaths true + + - name: Checkout Anomaly-Detection + uses: actions/checkout@v2 + with: + path: anomaly-detection + repository: opensearch-project/anomaly-detection + ref: ${{ env.ANOMALY_DETECTION_PLUGIN_VERSION }} + + - name: Run Opensearch with plugin + run: | + cd anomaly-detection + ./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} & + timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done' + shell: bash + + - name: Checkout OpenSearch Dashboards + uses: actions/checkout@v2 + with: + repository: opensearch-project/OpenSearch-Dashboards + ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} + path: OpenSearch-Dashboards + + - name: Checkout Anomaly Detection OpenSearch Dashboards plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin + + - name: Get node and yarn versions + id: versions_step + run: | + echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" + echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" + + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: ${{ steps.versions_step.outputs.node_version }} + registry-url: 'https://registry.npmjs.org' + + - name: Install correct yarn version for OpenSearch Dashboards + run: | + npm uninstall -g yarn + echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" + npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + + - name: Bootstrap the plugin + run: | + cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin + yarn osd bootstrap + + - name: Run OpenSearch Dashboards server + run: | + cd OpenSearch-Dashboards + yarn start --no-base-path --no-watch & + shell: bash + + - name: Sleep using Windows powershell + run: Start-Sleep -s 400 + shell: powershell + + - name: Checkout opensearch-dashboards-functional-test + uses: actions/checkout@v2 + with: + path: opensearch-dashboards-functional-test + repository: opensearch-project/opensearch-dashboards-functional-test + ref: ${{ env.OPENSEARCH_DASHBOARDS_FTREPO_VERSION }} + + - name: Get Cypress version + id: cypress_version + run: | + echo "::set-output name=cypress_version::$(cat ./opensearch-dashboards-functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')" + + - name: Cache Cypress + id: cache-cypress + uses: actions/cache@v1 + with: + path: ~/AppData/Local/Cypress/Cache + key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }} + env: + CYPRESS_INSTALL_BINARY: ${{ steps.cypress_version.outputs.cypress_version }} + - run: npx cypress cache list + - run: npx cypress cache path + + - name: Run AD cypress tests + uses: cypress-io/github-action@v2 + with: + working-directory: opensearch-dashboards-functional-test + command: yarn run cypress run --env SECURITY_ENABLED=false --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/*.js