|
1 |
| -name: Cypress e2e integration tests workflow |
2 |
| -on: |
3 |
| - pull_request: |
4 |
| - branches: |
5 |
| - - "*" |
6 |
| - push: |
7 |
| - branches: |
8 |
| - - "*" |
9 |
| -env: |
10 |
| - OPENSEARCH_DASHBOARDS_VERSION: 'main' |
11 |
| - OPENSEARCH_VERSION: '3.0.0-SNAPSHOT' |
12 |
| - QUERY_INSIGHTS_BRANCH: 'main' |
13 |
| - GRADLE_VERSION: '7.6.1' |
14 |
| -jobs: |
15 |
| - tests: |
16 |
| - name: Run Cypress E2E tests |
17 |
| - strategy: |
18 |
| - matrix: |
19 |
| - os: [ubuntu-latest, windows-latest] |
20 |
| - include: |
21 |
| - - os: windows-latest |
22 |
| - cypress_cache_folder: ~/AppData/Local/Cypress/Cache |
23 |
| - - os: ubuntu-latest |
24 |
| - cypress_cache_folder: ~/.cache/Cypress |
25 |
| - runs-on: ${{ matrix.os }} |
26 |
| - env: |
27 |
| - # prevents extra Cypress installation progress messages |
28 |
| - CI: 1 |
29 |
| - # avoid warnings like "tput: No value for $TERM and no -T specified" |
30 |
| - TERM: xterm |
31 |
| - steps: |
32 |
| - - name: Set up JDK |
33 |
| - uses: actions/setup-java@v1 |
34 |
| - with: |
35 |
| - java-version: 21 |
36 |
| - |
37 |
| - - name: Enable longer filenames |
38 |
| - if: ${{ matrix.os == 'windows-latest' }} |
39 |
| - run: git config --system core.longpaths true |
40 |
| - |
41 |
| - - name: Checkout Query Insights |
42 |
| - uses: actions/checkout@v2 |
43 |
| - with: |
44 |
| - path: query-insights |
45 |
| - repository: opensearch-project/query-insights |
46 |
| - ref: ${{ env.QUERY_INSIGHTS_BRANCH }} |
47 |
| - |
48 |
| - - name: Set up Gradle |
49 |
| - uses: gradle/gradle-build-action@v2 |
50 |
| - with: |
51 |
| - gradle-version: ${{ env.GRADLE_VERSION }} |
52 |
| - |
53 |
| - - name: Run OpenSearch with Query Insights plugin |
54 |
| - run: | |
55 |
| - cd query-insights |
56 |
| - ./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} & |
57 |
| - sleep 300 |
58 |
| - shell: bash |
59 |
| - |
60 |
| - - name: Checkout OpenSearch-Dashboards |
61 |
| - uses: actions/checkout@v2 |
62 |
| - with: |
63 |
| - repository: opensearch-project/OpenSearch-Dashboards |
64 |
| - path: OpenSearch-Dashboards |
65 |
| - ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} |
66 |
| - |
67 |
| - - name: Checkout Query Insights Dashboards plugin |
68 |
| - uses: actions/checkout@v2 |
69 |
| - with: |
70 |
| - path: OpenSearch-Dashboards/plugins/query-insights-dashboards |
71 |
| - |
72 |
| - - name: Setup Node |
73 |
| - uses: actions/setup-node@v3 |
74 |
| - with: |
75 |
| - node-version-file: './OpenSearch-Dashboards/.nvmrc' |
76 |
| - registry-url: 'https://registry.npmjs.org' |
77 |
| - |
78 |
| - - name: Install Yarn |
79 |
| - # Need to use bash to avoid having a windows/linux specific step |
80 |
| - shell: bash |
81 |
| - run: | |
82 |
| - YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") |
83 |
| - echo "Installing yarn@$YARN_VERSION" |
84 |
| - npm i -g yarn@$YARN_VERSION |
85 |
| - - run: node -v |
86 |
| - - run: yarn -v |
87 |
| - |
88 |
| - - name: Bootstrap plugin/OpenSearch-Dashboards |
89 |
| - run: | |
90 |
| - cd OpenSearch-Dashboards/plugins/query-insights-dashboards |
91 |
| - yarn osd bootstrap --single-version=loose |
92 |
| -
|
93 |
| - - name: Run OpenSearch-Dashboards server |
94 |
| - run: | |
95 |
| - cd OpenSearch-Dashboards |
96 |
| - yarn start --no-base-path --no-watch --server.host="0.0.0.0" & |
97 |
| - shell: bash |
98 |
| - |
99 |
| - # Window is slow so wait longer |
100 |
| - - name: Sleep until OSD server starts - windows |
101 |
| - if: ${{ matrix.os == 'windows-latest' }} |
102 |
| - run: Start-Sleep -s 600 |
103 |
| - shell: powershell |
104 |
| - |
105 |
| - - name: Sleep until OSD server starts - non-windows |
106 |
| - if: ${{ matrix.os != 'windows-latest' }} |
107 |
| - run: sleep 500 |
108 |
| - shell: bash |
109 |
| - |
110 |
| - - name: Install Cypress |
111 |
| - run: | |
112 |
| - cd OpenSearch-Dashboards/plugins/query-insights-dashboards |
113 |
| - # This will install Cypress in case the binary is missing which can happen on Windows and Mac |
114 |
| - # If the binary exists, this will exit quickly so it should not be an expensive operation |
115 |
| - npx cypress install |
116 |
| - shell: bash |
117 |
| - |
118 |
| - - name: Get Cypress version |
119 |
| - id: cypress_version |
120 |
| - run: | |
121 |
| - cd OpenSearch-Dashboards/plugins/query-insights-dashboards |
122 |
| - echo "::set-output name=cypress_version::$(cat ./package.json | jq '.dependencies.cypress' | tr -d '"')" |
123 |
| -
|
124 |
| - - name: Cache Cypress |
125 |
| - id: cache-cypress |
126 |
| - uses: actions/cache@v2 |
127 |
| - with: |
128 |
| - path: ${{ matrix.cypress_cache_folder }} |
129 |
| - key: cypress-cache-v2-${{ matrix.os }}-${{ hashFiles('OpenSearch-Dashboards/plugins/query-insights-dashboards/package.json') }} |
130 |
| - |
131 |
| - # for now just chrome, use matrix to do all browsers later |
132 |
| - - name: Cypress tests |
133 |
| - uses: cypress-io/github-action@v5 |
134 |
| - with: |
135 |
| - working-directory: OpenSearch-Dashboards/plugins/query-insights-dashboards |
136 |
| - command: yarn run cypress run |
137 |
| - wait-on: 'http://localhost:5601' |
138 |
| - wait-on-timeout: 600 |
139 |
| - browser: chrome |
140 |
| - env: |
141 |
| - CYPRESS_CACHE_FOLDER: ${{ matrix.cypress_cache_folder }} |
142 |
| - |
143 |
| - # Screenshots are only captured on failure, will change this once we do visual regression tests |
144 |
| - - uses: actions/upload-artifact@v4 |
145 |
| - if: failure() |
146 |
| - with: |
147 |
| - name: cypress-screenshots-${{ matrix.os }} |
148 |
| - path: OpenSearch-Dashboards/plugins/query-insights-dashboards/cypress/screenshots |
149 |
| - |
150 |
| - # Test run video was always captured, so this action uses "always()" condition |
151 |
| - - uses: actions/upload-artifact@v4 |
152 |
| - if: always() |
153 |
| - with: |
154 |
| - name: cypress-videos-${{ matrix.os }} |
155 |
| - path: OpenSearch-Dashboards/plugins/query-insights-dashboards/cypress/videos |
| 1 | +name: Cypress e2e integration tests workflow |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - "*" |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - "*" |
| 9 | +env: |
| 10 | + OPENSEARCH_DASHBOARDS_VERSION: 'main' |
| 11 | + OPENSEARCH_VERSION: '3.0.0-SNAPSHOT' |
| 12 | + QUERY_INSIGHTS_BRANCH: 'main' |
| 13 | + GRADLE_VERSION: '7.6.1' |
| 14 | +jobs: |
| 15 | + tests: |
| 16 | + name: Run Cypress E2E tests |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + os: [ubuntu-latest, windows-latest] |
| 20 | + include: |
| 21 | + - os: windows-latest |
| 22 | + cypress_cache_folder: ~/AppData/Local/Cypress/Cache |
| 23 | + - os: ubuntu-latest |
| 24 | + cypress_cache_folder: ~/.cache/Cypress |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + env: |
| 27 | + # prevents extra Cypress installation progress messages |
| 28 | + CI: 1 |
| 29 | + # avoid warnings like "tput: No value for $TERM and no -T specified" |
| 30 | + TERM: xterm |
| 31 | + steps: |
| 32 | + - name: Set up JDK |
| 33 | + uses: actions/setup-java@v1 |
| 34 | + with: |
| 35 | + java-version: 21 |
| 36 | + |
| 37 | + - name: Enable longer filenames |
| 38 | + if: ${{ matrix.os == 'windows-latest' }} |
| 39 | + run: git config --system core.longpaths true |
| 40 | + |
| 41 | + - name: Checkout Query Insights |
| 42 | + uses: actions/checkout@v2 |
| 43 | + with: |
| 44 | + path: query-insights |
| 45 | + repository: opensearch-project/query-insights |
| 46 | + ref: ${{ env.QUERY_INSIGHTS_BRANCH }} |
| 47 | + |
| 48 | + - name: Set up Gradle |
| 49 | + uses: gradle/gradle-build-action@v2 |
| 50 | + with: |
| 51 | + gradle-version: ${{ env.GRADLE_VERSION }} |
| 52 | + |
| 53 | + - name: Run OpenSearch with Query Insights plugin |
| 54 | + run: | |
| 55 | + cd query-insights |
| 56 | + ./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} & |
| 57 | + sleep 300 |
| 58 | + shell: bash |
| 59 | + |
| 60 | + - name: Checkout OpenSearch-Dashboards |
| 61 | + uses: actions/checkout@v2 |
| 62 | + with: |
| 63 | + repository: opensearch-project/OpenSearch-Dashboards |
| 64 | + path: OpenSearch-Dashboards |
| 65 | + ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} |
| 66 | + |
| 67 | + - name: Checkout Query Insights Dashboards plugin |
| 68 | + uses: actions/checkout@v2 |
| 69 | + with: |
| 70 | + path: OpenSearch-Dashboards/plugins/query-insights-dashboards |
| 71 | + |
| 72 | + - name: Setup Node |
| 73 | + uses: actions/setup-node@v3 |
| 74 | + with: |
| 75 | + node-version-file: './OpenSearch-Dashboards/.nvmrc' |
| 76 | + registry-url: 'https://registry.npmjs.org' |
| 77 | + |
| 78 | + - name: Install Yarn |
| 79 | + # Need to use bash to avoid having a windows/linux specific step |
| 80 | + shell: bash |
| 81 | + run: | |
| 82 | + YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") |
| 83 | + echo "Installing yarn@$YARN_VERSION" |
| 84 | + npm i -g yarn@$YARN_VERSION |
| 85 | + - run: node -v |
| 86 | + - run: yarn -v |
| 87 | + |
| 88 | + - name: Bootstrap plugin/OpenSearch-Dashboards |
| 89 | + run: | |
| 90 | + cd OpenSearch-Dashboards/plugins/query-insights-dashboards |
| 91 | + yarn osd bootstrap --single-version=loose |
| 92 | +
|
| 93 | + - name: Run OpenSearch-Dashboards server |
| 94 | + run: | |
| 95 | + cd OpenSearch-Dashboards |
| 96 | + yarn start --no-base-path --no-watch --server.host="0.0.0.0" & |
| 97 | + shell: bash |
| 98 | + |
| 99 | + # Window is slow so wait longer |
| 100 | + - name: Sleep until OSD server starts - windows |
| 101 | + if: ${{ matrix.os == 'windows-latest' }} |
| 102 | + run: Start-Sleep -s 600 |
| 103 | + shell: powershell |
| 104 | + |
| 105 | + - name: Sleep until OSD server starts - non-windows |
| 106 | + if: ${{ matrix.os != 'windows-latest' }} |
| 107 | + run: sleep 500 |
| 108 | + shell: bash |
| 109 | + |
| 110 | + - name: Install Cypress |
| 111 | + run: | |
| 112 | + cd OpenSearch-Dashboards/plugins/query-insights-dashboards |
| 113 | + # This will install Cypress in case the binary is missing which can happen on Windows and Mac |
| 114 | + # If the binary exists, this will exit quickly so it should not be an expensive operation |
| 115 | + npx cypress install |
| 116 | + shell: bash |
| 117 | + |
| 118 | + - name: Get Cypress version |
| 119 | + id: cypress_version |
| 120 | + run: | |
| 121 | + cd OpenSearch-Dashboards/plugins/query-insights-dashboards |
| 122 | + echo "::set-output name=cypress_version::$(cat ./package.json | jq '.dependencies.cypress' | tr -d '"')" |
| 123 | +
|
| 124 | + - name: Cache Cypress |
| 125 | + id: cache-cypress |
| 126 | + uses: actions/cache@v2 |
| 127 | + with: |
| 128 | + path: ${{ matrix.cypress_cache_folder }} |
| 129 | + key: cypress-cache-v2-${{ matrix.os }}-${{ hashFiles('OpenSearch-Dashboards/plugins/query-insights-dashboards/package.json') }} |
| 130 | + |
| 131 | + # for now just chrome, use matrix to do all browsers later |
| 132 | + - name: Cypress tests |
| 133 | + uses: cypress-io/github-action@v5 |
| 134 | + with: |
| 135 | + working-directory: OpenSearch-Dashboards/plugins/query-insights-dashboards |
| 136 | + command: yarn run cypress run |
| 137 | + wait-on: 'http://localhost:5601' |
| 138 | + wait-on-timeout: 600 |
| 139 | + browser: chrome |
| 140 | + env: |
| 141 | + CYPRESS_CACHE_FOLDER: ${{ matrix.cypress_cache_folder }} |
| 142 | + |
| 143 | + # Screenshots are only captured on failure, will change this once we do visual regression tests |
| 144 | + - uses: actions/upload-artifact@v4 |
| 145 | + if: failure() |
| 146 | + with: |
| 147 | + name: cypress-screenshots-${{ matrix.os }} |
| 148 | + path: OpenSearch-Dashboards/plugins/query-insights-dashboards/cypress/screenshots |
| 149 | + |
| 150 | + # Test run video was always captured, so this action uses "always()" condition |
| 151 | + - uses: actions/upload-artifact@v4 |
| 152 | + if: always() |
| 153 | + with: |
| 154 | + name: cypress-videos-${{ matrix.os }} |
| 155 | + path: OpenSearch-Dashboards/plugins/query-insights-dashboards/cypress/videos |
0 commit comments