Skip to content

Commit 47b9db9

Browse files
authored
Merge branch 'main' into tracesLoadSort
2 parents 7e5d651 + 16d1093 commit 47b9db9

File tree

6 files changed

+53
-520
lines changed

6 files changed

+53
-520
lines changed

.cypress/integration/app_analytics_test/app_analytics.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ describe('Viewing application', () => {
303303

304304
it('Opens service detail flyout when Service Name is clicked', () => {
305305
cy.get('[data-test-subj="app-analytics-serviceTab"]').click();
306+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
306307
cy.get('*[data-test-subj^="service-link"]').eq(0).click();
307308
cy.get('[data-test-subj="serviceDetailFlyoutTitle"]').should('be.visible');
308309
cy.get('[data-test-subj="Number of connected servicesDescriptionList"]').should('contain', '3');
@@ -319,6 +320,7 @@ describe('Viewing application', () => {
319320

320321
it('Opens trace detail flyout when Trace ID is clicked', () => {
321322
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
323+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
322324
cy.get('[title="03f9c770db5ee2f1caac0afc36db49ba"]').click();
323325
cy.get('[data-test-subj="traceDetailFlyoutTitle"]').should('be.visible');
324326
cy.get('[data-test-subj="traceDetailFlyout"]').within(($flyout) => {
@@ -339,6 +341,7 @@ describe('Viewing application', () => {
339341

340342
it('Opens span detail flyout when Span ID is clicked', () => {
341343
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
344+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
342345
cy.get('input[type="search"]').click().type(`5ff3516909562c60`);
343346
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
344347
cy.get('[data-test-subj="dataGridRowCell"]').contains('5ff3516909562c60').click();
@@ -432,6 +435,7 @@ describe('Viewing application', () => {
432435
changeTimeTo24('months');
433436
cy.get('[data-test-subj="app-analytics-logTab"]').click();
434437
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
438+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
435439
cy.get('[id="explorerPlotComponent"]', { timeout: timeoutDelay }).should('exist');
436440
cy.get('[data-test-subj="searchAutocompleteTextArea"]').focus();
437441
cy.get('[data-test-subj="searchAutocompleteTextArea"]').type(' ' + query_two, {

.cypress/utils/app_constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export const changeTimeTo24 = (timeUnit) => {
140140
cy.get('[aria-label="Time unit"]').select(timeUnit);
141141
cy.get('.euiButton').contains('Apply').click();
142142
cy.get('[data-test-subj="superDatePickerApplyTimeButton"]').click();
143+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
143144
};
144145

145146
export const expectMessageOnHover = (button, message) => {

.github/workflows/integration-tests-workflow.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,6 @@ jobs:
178178
name: dashboard.logs
179179
path: OpenSearch-Dashboards/dashboard.log
180180

181-
- name: Install Cypress
182-
run: |
183-
cd ./OpenSearch-Dashboards/plugins/dashboards-observability
184-
npx cypress install
185-
shell: bash
186-
187181
- name: Get Cypress version
188182
id: cypress_version
189183
run: |

.husky/hooks/check-test-only.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# Get all staged files
4+
staged_files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$')
5+
6+
if [[ -z "$staged_files" ]]; then
7+
exit 0
8+
fi
9+
10+
# Check for .only in Jest or Cypress test files
11+
only_pattern="(describe|it|test|context|cy)\.only\("
12+
found_only=false
13+
14+
for file in $staged_files; do
15+
# Check if file has .only
16+
if grep -E "$only_pattern" "$file" > /dev/null; then
17+
echo "Error: Found .only in $file"
18+
echo "Please remove all instances of .only before committing"
19+
found_only=true
20+
fi
21+
done
22+
23+
if [[ "$found_only" = true ]]; then
24+
exit 1
25+
fi
26+
27+
exit 0

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"osd": "node ../../scripts/osd",
88
"build": "yarn plugin-helpers build",
99
"test": "../../node_modules/.bin/jest --config ./test/jest.config.js",
10-
"cypress:run": "TZ=America/Los_Angeles cypress run",
11-
"cypress:open": "TZ=America/Los_Angeles cypress open",
10+
"cypress:run": "TZ=America/Los_Angeles ../../node_modules/cypress/bin/cypress run",
11+
"cypress:open": "TZ=America/Los_Angeles ../../node_modules/cypress/bin/cypress open",
1212
"plugin-helpers": "node ../../scripts/plugin_helpers",
1313
"prepare": "husky install",
1414
"lint:es": "node ../../scripts/eslint",
@@ -17,6 +17,7 @@
1717
},
1818
"lint-staged": {
1919
"*.{ts,tsx,js,jsx}": [
20+
".husky/hooks/check-test-only.sh",
2021
"yarn lint --fix"
2122
]
2223
},
@@ -47,7 +48,6 @@
4748
"@types/react-test-renderer": "^18.0.0",
4849
"@types/sanitize-filename": "^1.6.3",
4950
"antlr4ts-cli": "^0.5.0-alpha.4",
50-
"cypress": "12.17.4",
5151
"cypress-multi-reporters": "^1.6.4",
5252
"cypress-parallel": "^0.14.0",
5353
"cypress-watch-and-reload": "^1.10.6",
@@ -59,7 +59,7 @@
5959
"resolutions": {
6060
"@types/react": "^16.14.23",
6161
"react-syntax-highlighter": "^15.4.3",
62-
"prismjs": "^1.22.0",
62+
"prismjs": "^1.30.0",
6363
"trim": "^1.0.0",
6464
"lodash": "^4.17.21",
6565
"glob-parent": "^6.0.1",

0 commit comments

Comments
 (0)