Skip to content

Commit 1dfcc23

Browse files
author
Miki
authored
Merge branch 'main' into cc-2
Signed-off-by: Miki <[email protected]>
2 parents 4220384 + 15a19fa commit 1dfcc23

File tree

135 files changed

+7917
-1630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+7917
-1630
lines changed

.github/workflows/build_and_test_workflow.yml

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ jobs:
6262
disk-root: 'C:'
6363

6464
- name: Checkout code
65-
uses: actions/checkout@v3
65+
uses: actions/checkout@v4
6666

6767
- name: Setup JDK (Windows only)
6868
if: matrix.os == 'windows-latest'
69-
uses: actions/setup-java@v3
69+
uses: actions/setup-java@v4
7070
with:
7171
java-version: '11'
7272
distribution: 'adopt'
7373

7474
- name: Setup Node
75-
uses: actions/setup-node@v3
75+
uses: actions/setup-node@v4
7676
with:
7777
node-version-file: '.nvmrc'
7878
registry-url: 'https://registry.npmjs.org'
@@ -88,7 +88,7 @@ jobs:
8888
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
8989

9090
- name: Initialize Yarn Cache
91-
uses: actions/cache@v3
91+
uses: actions/cache@v4
9292
if: matrix.os != 'windows-latest'
9393
with:
9494
path: ${{ env.YARN_CACHE_LOCATION }}
@@ -133,10 +133,10 @@ jobs:
133133
runs-on: ubuntu-latest
134134
steps:
135135
- name: Checkout code
136-
uses: actions/checkout@v3
136+
uses: actions/checkout@v4
137137

138138
- name: Setup Node
139-
uses: actions/setup-node@v3
139+
uses: actions/setup-node@v4
140140
with:
141141
node-version-file: '.nvmrc'
142142
registry-url: 'https://registry.npmjs.org'
@@ -151,7 +151,7 @@ jobs:
151151
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
152152

153153
- name: Initialize Yarn Cache
154-
uses: actions/cache@v3
154+
uses: actions/cache@v4
155155
with:
156156
path: ${{ env.YARN_CACHE_LOCATION }}
157157
key: yarn-${{ hashFiles('**/yarn.lock') }}
@@ -161,6 +161,25 @@ jobs:
161161
- name: Run bootstrap
162162
run: yarn osd bootstrap
163163

164+
- name: Check for yarn.lock changes
165+
run: |
166+
if [[ `git status --porcelain yarn.lock` ]]; then
167+
echo -e "\033[31mThe yarn.lock file is out of sync!\033[0m"
168+
git diff
169+
exit 1
170+
fi
171+
172+
- name: Generate dev docs
173+
run: yarn docs:generateDevDocs
174+
175+
- name: Check for dev docs changes
176+
run: |
177+
if [[ `git status --porcelain docs/_sidebar.md` ]]; then
178+
echo -e "\033[31mThe dev docs are out of sync; run yarn docs:generateDevDocs and amend the PR.\033[0m"
179+
git diff
180+
exit 1
181+
fi
182+
164183
- name: Run linter
165184
id: linter
166185
run: yarn lint
@@ -169,6 +188,10 @@ jobs:
169188
id: notice-validate
170189
run: yarn notice:validate
171190

191+
- name: Validate licenses
192+
id: i18n-licenses
193+
run: yarn checkLicenses
194+
172195
- name: Check i18n
173196
id: i18n-check
174197
run: yarn i18n:check
@@ -203,17 +226,17 @@ jobs:
203226
disk-root: 'C:'
204227

205228
- name: Checkout code
206-
uses: actions/checkout@v3
229+
uses: actions/checkout@v4
207230

208231
- name: Setup JDK (Windows only)
209232
if: matrix.os == 'windows-latest'
210-
uses: actions/setup-java@v3
233+
uses: actions/setup-java@v4
211234
with:
212235
java-version: '11'
213236
distribution: 'adopt'
214237

215238
- name: Setup Node
216-
uses: actions/setup-node@v3
239+
uses: actions/setup-node@v4
217240
with:
218241
node-version-file: '.nvmrc'
219242
registry-url: 'https://registry.npmjs.org'
@@ -229,7 +252,7 @@ jobs:
229252
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
230253

231254
- name: Initialize Yarn Cache
232-
uses: actions/cache@v3
255+
uses: actions/cache@v4
233256
if: matrix.os != 'windows-latest'
234257
with:
235258
path: ${{ env.YARN_CACHE_LOCATION }}
@@ -319,17 +342,17 @@ jobs:
319342
disk-root: 'C:'
320343

321344
- name: Checkout code
322-
uses: actions/checkout@v3
345+
uses: actions/checkout@v4
323346

324347
- name: Setup JDK (Windows only)
325348
if: matrix.os == 'windows-latest'
326-
uses: actions/setup-java@v3
349+
uses: actions/setup-java@v4
327350
with:
328351
java-version: '11'
329352
distribution: 'adopt'
330353

331354
- name: Setup Node
332-
uses: actions/setup-node@v3
355+
uses: actions/setup-node@v4
333356
with:
334357
node-version-file: '.nvmrc'
335358
registry-url: 'https://registry.npmjs.org'
@@ -345,7 +368,7 @@ jobs:
345368
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
346369

347370
- name: Initialize Yarn Cache
348-
uses: actions/cache@v3
371+
uses: actions/cache@v4
349372
if: matrix.os != 'windows-latest'
350373
with:
351374
path: ${{ env.YARN_CACHE_LOCATION }}
@@ -451,12 +474,12 @@ jobs:
451474
disk-root: 'C:'
452475

453476
- name: Checkout code
454-
uses: actions/checkout@v3
477+
uses: actions/checkout@v4
455478
with:
456479
path: ./artifacts
457480

458481
- name: Setup Node
459-
uses: actions/setup-node@v3
482+
uses: actions/setup-node@v4
460483
with:
461484
node-version-file: './artifacts/.nvmrc'
462485
registry-url: 'https://registry.npmjs.org'
@@ -472,7 +495,7 @@ jobs:
472495
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
473496

474497
- name: Initialize Yarn Cache
475-
uses: actions/cache@v3
498+
uses: actions/cache@v4
476499
if: matrix.os != 'windows-latest'
477500
with:
478501
path: ${{ env.YARN_CACHE_LOCATION }}
@@ -540,15 +563,15 @@ jobs:
540563
]
541564
steps:
542565
- name: Checkout code
543-
uses: actions/checkout@v3
566+
uses: actions/checkout@v4
544567
with:
545568
path: ./artifacts
546569

547570
- run: echo Running backwards compatibility tests for version ${{ matrix.version }}
548571
- run: echo [NOTE] These tests will be ran using Linux x64 release builds without security
549572

550573
- name: Setup Node
551-
uses: actions/setup-node@v3
574+
uses: actions/setup-node@v4
552575
with:
553576
node-version-file: './artifacts/.nvmrc'
554577
registry-url: 'https://registry.npmjs.org'
@@ -583,7 +606,7 @@ jobs:
583606
run: echo "BWC_VERSIONS=${{ matrix.version }}" >> $GITHUB_ENV
584607

585608
- name: Download OpenSearch Dashboards
586-
uses: actions/download-artifact@v4.1.7
609+
uses: actions/download-artifact@v4
587610
id: download
588611
with:
589612
name: linux-x64-${{ env.VERSION }}
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Run cypress tests with S3
2+
3+
# trigger once PR has been merged
4+
on:
5+
push:
6+
branches: ['main', '[0-9]+\.x', '[0-9]+\.[0-9]+']
7+
paths-ignore:
8+
- '**/*.md'
9+
- '.lycheeignore'
10+
- 'changelogs/fragments/**'
11+
workflow_dispatch:
12+
inputs:
13+
test_repo:
14+
description: 'Cypress test repo'
15+
default: 'opensearch-project/opensearch-dashboards-functional-test'
16+
required: true
17+
type: string
18+
test_branch:
19+
description: 'Cypress test branch (default: source branch)'
20+
required: false
21+
type: string
22+
specs:
23+
description: 'Tests to run (default: osd:ciGroup10)'
24+
required: false
25+
type: string
26+
pr_number:
27+
description: 'PR Number (optional)'
28+
required: false
29+
type: number
30+
31+
env:
32+
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
33+
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
34+
FTR_PATH: 'ftr'
35+
CYPRESS_BROWSER: 'chromium'
36+
CYPRESS_VISBUILDER_ENABLED: true
37+
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
38+
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
39+
NODE_OPTIONS: '--max-old-space-size=6144 --dns-result-order=ipv4first'
40+
LATEST_VERSION: '2.17.0'
41+
42+
jobs:
43+
cypress-tests:
44+
runs-on: ubuntu-latest
45+
environment: flint-test
46+
container:
47+
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
48+
options: --user 1001
49+
env:
50+
START_CMD: 'node scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=true --uiSettings.overrides[''home:useNewHomePage'']=true --data_source.enabled=true --workspace.enabled=true --opensearch.ignoreVersionMismatch=true'
51+
OPENSEARCH_SNAPSHOT_CMD: '/bin/bash -c "./opensearch-2.17.0/opensearch-tar-install.sh &"'
52+
name: Run cypress tests (osd:ciGroup10)
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v2
56+
57+
- name: Setup Node
58+
uses: actions/setup-node@v2
59+
with:
60+
node-version-file: '.nvmrc'
61+
registry-url: 'https://registry.npmjs.org'
62+
63+
- name: Setup Yarn
64+
run: |
65+
npm uninstall -g yarn
66+
67+
68+
- name: Run bootstrap
69+
run: yarn osd bootstrap
70+
71+
- name: Build plugins
72+
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 12
73+
74+
- name: Checkout FT repo
75+
uses: actions/checkout@v2
76+
with:
77+
path: ${{ env.FTR_PATH }}
78+
repository: ${{ env.TEST_REPO }}
79+
ref: '${{ env.TEST_BRANCH }}'
80+
81+
- name: Setup spec files
82+
if: ${{ inputs.specs == '' }}
83+
shell: bash
84+
run: |
85+
DASHBOARDS_SPEC="$(yarn --silent osd:ciGroup10)"
86+
echo "DASHBOARDS_SPEC=${DASHBOARDS_SPEC}" >> $GITHUB_ENV
87+
echo "DASHBOARDS_SPEC=${DASHBOARDS_SPEC}"
88+
89+
- name: Download OpenSearch
90+
uses: suisei-cn/[email protected]
91+
with:
92+
url: https://artifacts.opensearch.org/releases/bundle/opensearch/${{ env.LATEST_VERSION }}/opensearch-${{ env.LATEST_VERSION }}-linux-x64.tar.gz
93+
94+
- name: Extract OpenSearch
95+
run: |
96+
tar -xzf opensearch-*.tar.gz
97+
rm -f opensearch-*.tar.gz
98+
shell: bash
99+
100+
- name: Remove security plugin
101+
run: |
102+
/bin/bash -c "yes | ./opensearch-${{ env.LATEST_VERSION }}/bin/opensearch-plugin remove opensearch-security"
103+
shell: bash
104+
105+
- name: Run OpenSearch
106+
run: |
107+
/bin/bash -c "./opensearch-2.17.0/opensearch-tar-install.sh &"
108+
sleep 30
109+
shell: bash
110+
111+
- name: Clear Cypress Cache
112+
run: npx cypress cache clear
113+
114+
- name: Run Dashboards Cypress tests with query enhancements
115+
uses: cypress-io/github-action@v6
116+
env:
117+
S3_CONNECTION_URL: ${{ secrets.S3_CONNECTION_URL }}
118+
S3_CONNECTION_USERNAME: ${{ secrets.S3_CONNECTION_USERNAME }}
119+
S3_CONNECTION_PASSWORD: ${{ secrets.S3_CONNECTION_PASSWORD }}
120+
with:
121+
install-command: npx cypress install --force
122+
start: ${{ env.START_CMD }}
123+
wait-on: 'http://localhost:9200, http://localhost:5601'
124+
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.DASHBOARDS_SPEC }}
125+
126+
- name: Upload Dashboards screenshots
127+
if: failure()
128+
uses: actions/upload-artifact@v4
129+
with:
130+
name: dashboards-cypress-screenshots-10
131+
path: cypress/screenshots
132+
retention-days: 1
133+
134+
- name: Upload Dashboards repo videos
135+
uses: actions/upload-artifact@v4
136+
if: always()
137+
with:
138+
name: dashboards-cypress-videos-10
139+
path: cypress/videos
140+
retention-days: 1
141+
142+
- name: Upload Dashboards repo results
143+
uses: actions/upload-artifact@v4
144+
if: always()
145+
with:
146+
name: dashboards-cypress-results-10
147+
path: cypress/results
148+
retention-days: 1

0 commit comments

Comments
 (0)