Skip to content

Commit 5d4ef82

Browse files
ohltyleramitgalitz
authored andcommitted
Add windows env to integration test workflow (#390)
Signed-off-by: Tyler Ohlsen <[email protected]> (cherry picked from commit e5038e5)
1 parent caedfff commit 5d4ef82

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

.github/workflows/remote-integ-tests-workflow.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,57 @@ jobs:
1919
name: Run integ tests without security
2020
strategy:
2121
matrix:
22-
os: [ubuntu-latest]
22+
os: [ubuntu-latest, windows-latest]
2323
java: [11]
24+
include:
25+
- os: windows-latest
26+
cypress_cache_folder: ~/AppData/Local/Cypress/Cache
27+
- os: ubuntu-latest
28+
cypress_cache_folder: ~/.cache/Cypress
2429
runs-on: ${{ matrix.os }}
2530
steps:
31+
- name: Set up Java 11
32+
uses: actions/setup-java@v3
33+
with:
34+
distribution: 'corretto'
35+
java-version: '11'
36+
37+
- name: Enable longer filenames
38+
if: ${{ matrix.os == 'windows-latest' }}
39+
run: git config --system core.longpaths true
40+
2641
- name: Checkout Anomaly-Detection
2742
uses: actions/checkout@v2
2843
with:
2944
path: anomaly-detection
3045
repository: opensearch-project/anomaly-detection
3146
ref: ${{ env.ANOMALY_DETECTION_PLUGIN_VERSION }}
32-
- name: Run Opensearch with plugin
47+
48+
- name: Run OpenSearch with plugin
3349
run: |
3450
cd anomaly-detection
3551
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
3652
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done'
53+
shell: bash
54+
3755
- name: Checkout OpenSearch Dashboards
3856
uses: actions/checkout@v2
3957
with:
4058
repository: opensearch-project/OpenSearch-Dashboards
4159
ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
4260
path: OpenSearch-Dashboards
61+
4362
- name: Checkout Anomaly Detection OpenSearch Dashboards plugin
4463
uses: actions/checkout@v2
4564
with:
4665
path: OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
66+
4767
- name: Get node and yarn versions
4868
id: versions_step
4969
run: |
5070
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
5171
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
72+
5273
- name: Setup node
5374
uses: actions/setup-node@v1
5475
with:
@@ -60,37 +81,56 @@ jobs:
6081
npm uninstall -g yarn
6182
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
6283
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
84+
6385
- name: Bootstrap the plugin
6486
run: |
6587
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
6688
yarn osd bootstrap
89+
6790
- name: Run OpenSearch Dashboards server
6891
run: |
6992
cd OpenSearch-Dashboards
7093
yarn start --no-base-path --no-watch &
71-
sleep 300
94+
shell: bash
95+
96+
# Window is slow so wait longer
97+
- name: Sleep until OSD server starts - windows
98+
if: ${{ matrix.os == 'windows-latest' }}
99+
run: Start-Sleep -s 400
100+
shell: powershell
101+
102+
- name: Sleep until OSD server starts - non-windows
103+
if: ${{ matrix.os != 'windows-latest' }}
104+
run: sleep 300
105+
shell: bash
106+
72107
- name: Checkout opensearch-dashboards-functional-test
73108
uses: actions/checkout@v2
74109
with:
75110
path: opensearch-dashboards-functional-test
76111
repository: opensearch-project/opensearch-dashboards-functional-test
77112
ref: ${{ env.OPENSEARCH_DASHBOARDS_FTREPO_VERSION }}
113+
78114
- name: Get Cypress version
79115
id: cypress_version
80116
run: |
81117
echo "::set-output name=cypress_version::$(cat ./opensearch-dashboards-functional-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
118+
82119
- name: Cache Cypress
83120
id: cache-cypress
84121
uses: actions/cache@v1
85122
with:
86-
path: ~/.cache/Cypress
123+
path: ${{ matrix.cypress_cache_folder }}
87124
key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }}
88125
env:
89126
CYPRESS_INSTALL_BINARY: ${{ steps.cypress_version.outputs.cypress_version }}
90127
- run: npx cypress cache list
91128
- run: npx cypress cache path
129+
92130
- name: Run AD cypress tests
93131
uses: cypress-io/github-action@v2
94132
with:
95133
working-directory: opensearch-dashboards-functional-test
96134
command: yarn run cypress run --env SECURITY_ENABLED=false --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/*.js
135+
env:
136+
CYPRESS_CACHE_FOLDER: ${{ matrix.cypress_cache_folder }}

0 commit comments

Comments
 (0)