Skip to content

Commit 250a88f

Browse files
authored
Add remote integ test workflow; clean up old integ test workflow (opensearch-project#163)
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
1 parent 5d9eb9a commit 250a88f

File tree

2 files changed

+98
-6
lines changed

2 files changed

+98
-6
lines changed

.github/workflows/e2e-tests-workflow.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Soon-to-be deprecated way of running integ tests. In the future all tests will be moved to
2+
# https://github.com/opensearch-project/opensearch-dashboards-functional-test
13
name: E2E tests workflow
24
on:
35
push:
@@ -10,7 +12,7 @@ env:
1012
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
1113
OPENSEARCH_VERSION: '1.3.0-SNAPSHOT'
1214
jobs:
13-
test-with-security:
15+
test-without-security:
1416
name: Run e2e tests without security
1517
strategy:
1618
matrix:
@@ -59,10 +61,6 @@ jobs:
5961
run: |
6062
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
6163
yarn osd bootstrap
62-
- name: Build the artifact
63-
run: |
64-
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
65-
yarn build
6664
- name: Run OpenSearch Dashboards server
6765
run: |
6866
cd OpenSearch-Dashboards
@@ -72,4 +70,4 @@ jobs:
7270
uses: cypress-io/github-action@v2.5.0
7371
with:
7472
working-directory: OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
75-
command: yarn cy:run --env SECURITY_ENABLED=true
73+
command: yarn cy:run --env SECURITY_ENABLED=false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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

Comments
 (0)