-
Notifications
You must be signed in to change notification settings - Fork 113
92 lines (92 loc) · 4.26 KB
/
release-signoff-chromium-tests-in-memory-10.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Release signoff for bundled OpenSearch Dashboards with Dashboards plugins (x64, Chromium, numTestsKeptInMemory=10)
on:
schedule:
- cron: '30 */3 * * *'
jobs:
tests:
name: Run Cypress E2E tests
runs-on: ubuntu-latest
env:
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
# make Node run in ipv4 first so that cypress can detect 5601 port in CI environment
NODE_OPTIONS: '--max-old-space-size=6144 --dns-result-order=ipv4first'
# 2.12 onwards security demo configuration require a custom admin password
OPENSEARCH_INITIAL_ADMIN_PASSWORD: 'myStrongPassword123!'
# Disable command log to unhang
CYPRESS_NO_COMMAND_LOG: 1
steps:
- name: Checkout functional-test
uses: actions/checkout@v2
with:
repository: ${{github.repository}}
path: functional-test
- name: Get package version
working-directory: functional-test
run: |
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
- name: Get and run OpenSearch
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
cd opensearch-${{ env.VERSION }}/
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
- name: Get OpenSearch-Dashboards
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
- name: Get node and yarn versions
id: versions
run: |
node_version_temp=$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")
echo "node_version=$node_version_temp" >> $GITHUB_ENV
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Run OpenSearch-Dashboards server
run: |
cd opensearch-dashboards-${{ env.VERSION }}
bin/opensearch-dashboards serve &
timeout 300 bash -c 'while [[ "$(curl -s -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
- name: Get Cypress version
id: cypress_version
run: |
cypress_version_temp=$(cat ./monetery-test/package.json | jq -r '.devDependencies.cypress')
echo "cypress_version=$cypress_version_temp" >> $GITHUB_ENV
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v1
with:
path: ~/.cache/Cypress
key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }}
env:
CYPRESS_INSTALL_BINARY: ${{ steps.cypress_version.outputs.cypress_version }}
- name: Run npm install
run: |
cd functional-test
npm install
- run: npx cypress cache list
- run: npx cypress cache path
- name: Cypress tests
uses: cypress-io/github-action@v2
with:
working-directory: functional-test
command: yarn cypress:release-chromium-10
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: functional-test/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
if: always()
with:
name: cypress-videos
path: functional-test/cypress/videos