1
+ name : FTR E2E FF Workbench Test
2
+
3
+ on : [pull_request, push]
4
+
5
+ env :
6
+ CI : 1
7
+ TERM : xterm
8
+ OPENSEARCH_DASHBOARDS_VERSION : ' 2.x'
9
+
10
+ jobs :
11
+ tests :
12
+ name : Run FTR E2E FF Workbench Tests
13
+ strategy :
14
+ fail-fast : false
15
+ matrix :
16
+ os : [ ubuntu-latest ]
17
+ jdk : [ 21 ]
18
+ runs-on : ${{ matrix.os }}
19
+
20
+ steps :
21
+ - name : Set up JDK
22
+ uses : actions/setup-java@v1
23
+ with :
24
+ java-version : ${{ matrix.jdk }}
25
+
26
+ - name : Checkout Flow-Framework
27
+ uses : actions/checkout@v2
28
+ with :
29
+ path : flow-framework
30
+ repository : opensearch-project/flow-framework
31
+ ref : ' ${{ github.base_ref }}'
32
+
33
+ - name : Run OpenSearch with plugin
34
+ run : |
35
+ cd flow-framework
36
+ ./gradlew run &
37
+ timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done'
38
+ shell : bash
39
+
40
+ - name : Check OpenSearch Running on Linux
41
+ if : ${{ runner.os != 'Windows'}}
42
+ run : curl http://localhost:9200/
43
+ shell : bash
44
+
45
+ - name : Checkout OpenSearch Dashboards
46
+ uses : actions/checkout@v2
47
+ with :
48
+ path : OpenSearch-Dashboards
49
+ repository : opensearch-project/OpenSearch-Dashboards
50
+ ref : ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
51
+ fetch-depth : 0
52
+ filter : |
53
+ cypress
54
+ test
55
+
56
+ - name : Checkout FF in OpenSearch Dashboards Plugins Dir
57
+ uses : actions/checkout@v2
58
+ with :
59
+ path : OpenSearch-Dashboards/plugins/dashboards-flow-framework
60
+
61
+ - id : tool-versions
62
+ run : |
63
+ echo "node_version=$(cat .node-version)" >> $GITHUB_OUTPUT
64
+ echo "yarn_version=$(jq -r '.engines.yarn' package.json)" >> $GITHUB_OUTPUT
65
+ working-directory : OpenSearch-Dashboards
66
+ shell : bash
67
+
68
+ - uses : actions/setup-node@v1
69
+ with :
70
+ node-version : ${{ steps.tool-versions.outputs.node_version }}
71
+ registry-url : ' https://registry.npmjs.org'
72
+
73
+ - name : Setup Opensearch Dashboards
74
+ run : |
75
+ npm uninstall -g yarn
76
+ echo "Installing yarn ${{ steps.tool-versions.outputs.yarn_version }}"
77
+ npm i -g yarn@${{ steps.tool-versions.outputs.yarn_version }}
78
+ yarn cache clean
79
+ yarn add sha.js
80
+ working-directory : OpenSearch-Dashboards
81
+ shell : bash
82
+
83
+ - name : Bootstrap Opensearch Dashboards
84
+ run : |
85
+ yarn osd bootstrap --single-version=loose
86
+ working-directory : OpenSearch-Dashboards/plugins/dashboards-flow-framework
87
+
88
+ - name : Run Opensearch Dashboards with FF Installed
89
+ run : |
90
+ nohup yarn start --no-base-path --no-watch --server.host="0.0.0.0" | tee dashboard.log &
91
+ sleep 60
92
+ working-directory : OpenSearch-Dashboards
93
+
94
+ - name : Check If OpenSearch Dashboards Is Ready
95
+ if : ${{ runner.os == 'Linux' }}
96
+ run : |
97
+ if timeout 600 grep -q "bundles compiled successfully after" <(tail -n0 -f dashboard.log); then
98
+ echo "OpenSearch Dashboards compiled successfully."
99
+ else
100
+ echo "Timeout for 600 seconds reached. OpenSearch Dashboards did not finish compiling."
101
+ exit 1
102
+ fi
103
+ working-directory : OpenSearch-Dashboards
104
+
105
+ - name : Show OpenSearch Dashboards Logs
106
+ if : always()
107
+ run : cat dashboard.log
108
+ working-directory : OpenSearch-Dashboards
109
+
110
+ - name : Health check
111
+ run : |
112
+ timeout 600 bash -c 'while [[ "$(curl -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
113
+ shell : bash
114
+
115
+ - name : Check OpenSearch Dashboards Running on Linux
116
+ if : ${{ runner.os != 'Windows'}}
117
+ run : curl http://localhost:5601/api/status
118
+ shell : bash
119
+
120
+ - name : Checkout Dashboards Functional Test Repo
121
+ uses : actions/checkout@v2
122
+ with :
123
+ path : opensearch-dashboards-functional-test
124
+ repository : opensearch-project/opensearch-dashboards-functional-test
125
+ ref : ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
126
+ fetch-depth : 0
127
+
128
+ - name : Install Cypress
129
+ run : |
130
+ npm install cypress --save-dev
131
+ shell : bash
132
+ working-directory : opensearch-dashboards-functional-test
133
+
134
+ - name : Get Cypress version
135
+ id : cypress_version
136
+ run : |
137
+ echo "::set-output name=cypress_version::$(cat ./package.json | jq '.dependencies.cypress' | tr -d '"')"
138
+ working-directory : opensearch-dashboards-functional-test
139
+
140
+ - name : Finding spec files and store to output
141
+ id : finding-files
142
+ run : |
143
+ {
144
+ echo 'FILELIST<<EOF'
145
+ find cypress/integration/plugins/dashboards-flow-framework -name '*.js' -print
146
+ echo EOF
147
+ } >> "$GITHUB_ENV"
148
+ working-directory : opensearch-dashboards-functional-test
149
+
150
+ - name : Run spec files from output
151
+ run : |
152
+ env CYPRESS_NO_COMMAND_LOG=1 yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/plugins/dashboards-flow-framework/*'
153
+ working-directory : opensearch-dashboards-functional-test
154
+
155
+ - name : Capture failure screenshots
156
+ uses : actions/upload-artifact@v4
157
+ if : failure()
158
+ with :
159
+ name : cypress-screenshots-${{ matrix.os }}
160
+ path : opensearch-dashboards-functional-test/cypress/screenshots
161
+
162
+ - name : Capture failure test video
163
+ uses : actions/upload-artifact@v4
164
+ if : failure()
165
+ with :
166
+ name : cypress-videos-${{ matrix.os }}
167
+ path : opensearch-dashboards-functional-test/cypress/videos
168
+
0 commit comments