-
Notifications
You must be signed in to change notification settings - Fork 30
92 lines (80 loc) · 4.83 KB
/
functional-test-template.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: OpenSearch Dashboards Functional Test Template
on:
workflow_call:
inputs:
endpoint:
required: true
type: string
secrets:
osd-user:
required: true
osd-user-password:
required: true
jobs:
OSD-Functional-Test-OSD:
runs-on: ubuntu-latest
steps:
- name: Checkout functional test repo
uses: actions/checkout@v3
with:
repository: elastic-analytics/opensearch-dashboards-functional-test
ref: playground
- name: Step 0 - Install dependencies for functional test
run: |
npm install
npm install -g yarn
- name: Step 1 - Check If OSD is Up
run: |
sleep 30s
curl -XGET --retry 15 --retry-delay 30 --retry-all-errors -k -u '${{secrets.osd-user}}:${{secrets.osd-user-password}}' '${{inputs.endpoint}}/api/status' > $HOME/osd-response.json
echo "OSD_STATUS=$(cat $HOME/osd-response.json | jq -r '.status.overall.state')" >> $GITHUB_ENV
- name: Step 2 - Run Functional Test For OSD
if: ${{ env.OSD_STATUS == 'green'}}
run: |
yarn cypress run --spec "cypress/integration/playground/dashboards/*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
Plugins:
runs-on: ubuntu-latest
needs: OSD-Functional-Test-OSD
strategy:
fail-fast: false
matrix:
run: ['OSD-Functional-Test-AD', 'OSD-Functional-Test-Alert', 'OSD-Functional-Test-Notifications', 'OSD-Functional-Test-Reports', 'OSD-Functional-Test-Observability', 'OSD-Functional-Test-IndexMan', 'OSD-Functional-Test-SecurityAnalytics']
steps:
- run: echo Run ${{ matrix.run }}
- name: Checkout functional test repo
uses: actions/checkout@v3
with:
repository: elastic-analytics/opensearch-dashboards-functional-test
ref: playground
- name: Install dependencies for functional test
run: |
npm install
npm install -g yarn
- name: Run Functional Test For AD
if: ${{ matrix.run == 'OSD-Functional-Test-AD' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_ad*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
- name: Run Functional Test For Alert
if: ${{ matrix.run == 'OSD-Functional-Test-Alert' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_alert*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
- name: Run Functional Test For Notifications
if: ${{ matrix.run == 'OSD-Functional-Test-Notifications' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_notifications*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
- name: Run Functional Test For Reports
if: ${{ matrix.run == 'OSD-Functional-Test-Reports' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_reports*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
- name: Run Functional Test For Observability
if: ${{ matrix.run == 'OSD-Functional-Test-Observability' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_observability*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
- name: Run Functional Test For Index Management
if: ${{ matrix.run == 'OSD-Functional-Test-IndexMan' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_index*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"
- name: Run Functional Test For Security Analytics
if: ${{ matrix.run == 'OSD-Functional-Test-SecurityAnalytics' }}
run: |
yarn cypress run --spec "cypress/integration/playground/plugins/playground_security_analytics*.js" --config "baseUrl=${{inputs.endpoint}}" --env "openSearchUrl=${{inputs.endpoint}},SECURITY_ENABLED=true,username=${{secrets.osd-user}},password=${{secrets.osd-user-password}}"