Skip to content

Commit 24b5659

Browse files
[Backport main] [Infra] Add CI groups for OSD core test cases to avoid flaky test (#1368)
* [Infra] Add CI groups for OSD core test cases to avoid flaky test (#1352) * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: run all Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: add ci-groups Signed-off-by: SuZhou-Joe <[email protected]> * feat: revert the deletion of windows flow Signed-off-by: SuZhou-Joe <[email protected]> * fix: integration test failure Signed-off-by: SuZhou-Joe <[email protected]> * fix: integration test failure Signed-off-by: SuZhou-Joe <[email protected]> --------- Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: Yulong Ruan <[email protected]> (cherry picked from commit bd5e0fb) * feat: merge Signed-off-by: SuZhou-Joe <[email protected]> --------- Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]>
1 parent c8cbf04 commit 24b5659

File tree

4 files changed

+132
-9
lines changed

4 files changed

+132
-9
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Cypress test for core Dashboards
2+
on:
3+
pull_request:
4+
branches: ['**']
5+
paths:
6+
- '.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml'
7+
- 'cypress/**/core-opensearch-dashboards/**'
8+
- 'cypress/utils/dashboards/**'
9+
push:
10+
branches: ['**']
11+
paths:
12+
- '.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml'
13+
- 'cypress/**/core-opensearch-dashboards/**'
14+
- 'cypress/utils/dashboards/**'
15+
16+
env:
17+
CI_GROUPS: "1,2,3,4,5,6,7,8,9"
18+
19+
jobs:
20+
get_spec:
21+
runs-on: 'ubuntu-latest'
22+
outputs:
23+
MATRIX_INCLUDES: ${{ steps.get_spec.outputs.MATRIX_INCLUDES }}
24+
steps:
25+
- name: Checkout Branch
26+
uses: actions/checkout@v3
27+
- name: Checkout cypress-test
28+
uses: actions/checkout@v2
29+
with:
30+
repository: ${{github.repository}}
31+
path: spec-detect
32+
- id: get_spec
33+
name: Get specs array
34+
run: |
35+
cd spec-detect
36+
result="["
37+
## split CI_Groups into array
38+
IFS="," read -a groups <<< "${{ env.CI_GROUPS }}"
39+
for group in "${groups[@]}"; do
40+
item="{\"ciGroup\": \"${group}\", \"specs\": "
41+
IFS="," read -a SPEC_ARRAY <<< "$(npm run -s osd:ciGroup${group})"
42+
FORMATTED_SPEC="\""
43+
for i in "${SPEC_ARRAY[@]}"; do
44+
FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/opensearch-dashboards/${i},"
45+
done
46+
FORMATTED_SPEC+="\" }"
47+
if [[ "${result}" != "[" ]];
48+
then
49+
result+=","
50+
fi
51+
item+="${FORMATTED_SPEC}"
52+
result+="${item}"
53+
done
54+
55+
result+=']';
56+
57+
echo ${result}
58+
echo "MATRIX_INCLUDES=${result}" >> "$GITHUB_OUTPUT"
59+
60+
tests-with-security:
61+
needs: ["get_spec"]
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
include: ${{ fromJSON(needs.get_spec.outputs.MATRIX_INCLUDES) }}
66+
name: (security)osd:ciGroup${{ matrix.ciGroup }}
67+
uses: ./.github/workflows/release-e2e-workflow-template.yml
68+
with:
69+
test-name: "osd:ciGroup${{ matrix.ciGroup }}"
70+
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec '${{ matrix.specs }}'
71+
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true
72+
73+
tests-without-security:
74+
needs: ["get_spec"]
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
include: ${{ fromJSON(needs.get_spec.outputs.MATRIX_INCLUDES) }}
79+
name: (non-security)osd:ciGroup${{ matrix.ciGroup }}
80+
uses: ./.github/workflows/release-e2e-workflow-template.yml
81+
with:
82+
test-name: "osd:ciGroup${{ matrix.ciGroup }}"
83+
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec '${{ matrix.specs }}'
84+
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true
85+
security-enabled: false
86+
87+
# Hold on windows test cases
88+
# https://github.com/opensearch-project/opensearch-dashboards-functional-test/actions/runs/9377445544/job/25819022121?pr=1352
89+
# tests-with-security-windows:
90+
# needs: ["get_spec"]
91+
# strategy:
92+
# fail-fast: false
93+
# matrix:
94+
# include: ${{ fromJSON(needs.get_spec.outputs.MATRIX_INCLUDES) }}
95+
# name: (security)osd:ciGroup${{ matrix.ciGroup }}
96+
# uses: ./.github/workflows/release-e2e-workflow-template-windows.yml
97+
# with:
98+
# test-name: "osd:ciGroup${{ matrix.ciGroup }}"
99+
# test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chrome --spec '${{ matrix.specs }}'
100+
101+
# tests-without-security-windows:
102+
# needs: ["get_spec"]
103+
# strategy:
104+
# fail-fast: false
105+
# matrix:
106+
# include: ${{ fromJSON(needs.get_spec.outputs.MATRIX_INCLUDES) }}
107+
# name: (non-security)osd:ciGroup${{ matrix.ciGroup }}
108+
# uses: ./.github/workflows/release-e2e-workflow-template-windows.yml
109+
# with:
110+
# test-name: "osd:ciGroup${{ matrix.ciGroup }}"
111+
# test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chrome --spec '${{ matrix.specs }}'
112+
# security-enabled: false

.github/workflows/cypress-workflow-bundle-snapshot-based-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
2828
# not useful now as the windows e2e template currently do not allow serving parameters
2929
#osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true
30-
security-enabled: false
30+
security-enabled: false

.github/workflows/cypress-workflow-bundle-snapshot-based.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,3 @@ jobs:
2626
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
2727
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true --usageCollection.uiMetric.enabled=true
2828
security-enabled: false
29-
30-
tests-with-multiple-data-source-and-disabled-local-cluster:
31-
uses: ./.github/workflows/release-e2e-workflow-template.yml
32-
with:
33-
test-name: Core Dashboards using Bundle Snapshot
34-
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/mds*.js'
35-
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true
36-
security-enabled: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: E2E Cypress tests workflow for MDS
2+
on:
3+
pull_request:
4+
branches: ['**']
5+
paths:
6+
- 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/mds*.js'
7+
push:
8+
branches: ['**']
9+
paths:
10+
- 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/mds*.js'
11+
12+
jobs:
13+
tests-with-multiple-data-source-and-disabled-local-cluster:
14+
uses: ./.github/workflows/release-e2e-workflow-template.yml
15+
with:
16+
test-name: MDS enabled and local cluster disabled
17+
test-command: env CYPRESS_DISABLE_LOCAL_CLUSTER=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/mds*.js'
18+
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --data_source.hideLocalCluster=true
19+
security-enabled: true

0 commit comments

Comments
 (0)