|
| 1 | +# Running AD integ tests stored in https://github.com/opensearch-project/opensearch-dashboards-functional-test |
| 2 | +# In the future we should pull dependencies from bundled build snapshots. Because that is not available |
| 3 | +# yet we build the cluster from source (besides core Opensearch, which is a pulled min artifact). |
| 4 | +name: Remote integ tests workflow |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | +env: |
| 13 | + OPENSEARCH_DASHBOARDS_VERSION: '1.x' |
| 14 | + OPENSEARCH_VERSION: '1.3.0-SNAPSHOT' |
| 15 | +jobs: |
| 16 | + test-without-security: |
| 17 | + name: Run integ tests without security |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + os: [ubuntu-latest] |
| 21 | + java: [14] |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + steps: |
| 24 | + - name: Checkout Anomaly-Detection |
| 25 | + uses: actions/checkout@v2 |
| 26 | + with: |
| 27 | + path: anomaly-detection |
| 28 | + repository: opensearch-project/anomaly-detection |
| 29 | + ref: 'main' |
| 30 | + - name: Run Opensearch with plugin |
| 31 | + run: | |
| 32 | + cd anomaly-detection |
| 33 | + ./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} & |
| 34 | + timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done' |
| 35 | + - name: Checkout OpenSearch Dashboards |
| 36 | + uses: actions/checkout@v2 |
| 37 | + with: |
| 38 | + repository: opensearch-project/OpenSearch-Dashboards |
| 39 | + ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} |
| 40 | + path: OpenSearch-Dashboards |
| 41 | + - name: Checkout Anomaly Detection OpenSearch Dashboards plugin |
| 42 | + uses: actions/checkout@v2 |
| 43 | + with: |
| 44 | + path: OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin |
| 45 | + - name: Get node and yarn versions |
| 46 | + id: versions_step |
| 47 | + run: | |
| 48 | + echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" |
| 49 | + echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" |
| 50 | + - name: Setup node |
| 51 | + uses: actions/setup-node@v1 |
| 52 | + with: |
| 53 | + node-version: ${{ steps.versions_step.outputs.node_version }} |
| 54 | + registry-url: 'https://registry.npmjs.org' |
| 55 | + |
| 56 | + - name: Install correct yarn version for OpenSearch Dashboards |
| 57 | + run: | |
| 58 | + npm uninstall -g yarn |
| 59 | + echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" |
| 60 | + npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} |
| 61 | + - name: Bootstrap the plugin |
| 62 | + run: | |
| 63 | + cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin |
| 64 | + yarn osd bootstrap |
| 65 | + - name: Run OpenSearch Dashboards server |
| 66 | + run: | |
| 67 | + cd OpenSearch-Dashboards |
| 68 | + yarn start --no-base-path --no-watch & |
| 69 | + sleep 300 |
| 70 | + - name: Checkout opensearch-dashboards-functional-test |
| 71 | + uses: actions/checkout@v2 |
| 72 | + with: |
| 73 | + path: opensearch-dashboards-functional-test |
| 74 | + repository: opensearch-project/opensearch-dashboards-functional-test |
| 75 | + ref: 'main' # TODO: change to a branch when the branching strategy in that repo has been established |
| 76 | + - name: Get Cypress version |
| 77 | + id: cypress_version |
| 78 | + run: | |
| 79 | + echo "::set-output name=cypress_version::$(cat ./opensearch-dashboards-functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')" |
| 80 | + - name: Cache Cypress |
| 81 | + id: cache-cypress |
| 82 | + uses: actions/cache@v1 |
| 83 | + with: |
| 84 | + path: ~/.cache/Cypress |
| 85 | + key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }} |
| 86 | + env: |
| 87 | + CYPRESS_INSTALL_BINARY: ${{ steps.cypress_version.outputs.cypress_version }} |
| 88 | + - run: npx cypress cache list |
| 89 | + - run: npx cypress cache path |
| 90 | + - name: Run AD cypress tests |
| 91 | + uses: cypress-io/github-action@v2 |
| 92 | + with: |
| 93 | + working-directory: opensearch-dashboards-functional-test |
| 94 | + command: yarn run cypress run --env SECURITY_ENABLED=false --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/*.js |
0 commit comments