Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unit & functional tests #48

Merged
merged 4 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,16 @@ jobs:
npm uninstall -g yarn
npm i -g [email protected]

# image has the latest chrome v99
# image has the chrome v109.0.5414
# Note: Chrome is installed in the container image defined above. It seems
# that OpenSearch periodically rebuilds this image, so the chromedriver
# version originally used for v2.4.1 no longer fits the version of
# Chrome installed in the image, causing the tests to fail. This is a
# temporary fix to get the tests to pass, as in their `main` branch, they
# have added an script to automatically detect the chrome version and
# installed the correct chromedriver accordingly.
- name: Setup chromedriver
run: yarn add --dev chromedriver@99.0.0
run: yarn add --dev chromedriver@109.0.0

- name: Run bootstrap
run: yarn osd bootstrap
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ env:
FTR_PATH: 'ftr'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot'
SPEC: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,'
SPEC: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
CYPRESS_ENV: 'env CYPRESS_VISBUILDER_ENABLED=true '
OPENSEARCH_VERSION: ${{ vars.OPENSEARCH_VERSION }}

jobs:
cypress-tests:
Expand Down Expand Up @@ -52,7 +53,7 @@ jobs:
with:
path: ${{ env.FTR_PATH }}
repository: opensearch-project/opensearch-dashboards-functional-test
ref: '${{ github.base_ref }}'
ref: ${{ env.OPENSEARCH_VERSION }}

- name: Get Cypress version
id: cypress_version
Expand All @@ -76,7 +77,7 @@ jobs:
working-directory: ${{ env.FTR_PATH }}
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: ${{ env.CYPRESS_ENV }} yarn cypress:run-without-security --browser chromium --spec ${{ env.SPEC }}
command: ${{ env.CYPRESS_ENV }} yarn cypress:run-without-security --browser chromium --config ignoreTestFiles="dashboard_sanity_test_spec.js" --spec ${{ env.SPEC }}

# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v3
Expand All @@ -85,7 +86,7 @@ jobs:
name: ftr-cypress-screenshots
path: ${{ env.FTR_PATH }}/cypress/screenshots
retention-days: 1

- uses: actions/upload-artifact@v3
if: always()
with:
Expand All @@ -98,4 +99,4 @@ jobs:
with:
name: ftr-cypress-results
path: ${{ env.FTR_PATH }}/cypress/results
retention-days: 1
retention-days: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2764,9 +2764,9 @@
defer-to-connect "^2.0.0"

"@testim/chrome-version@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.2.tgz#092005c5b77bd3bb6576a4677110a11485e11864"
integrity sha512-1c4ZOETSRpI0iBfIFUqU4KqwBAB2lHUAlBjZz/YqOHqwM9dTTzjV6Km0ZkiEiSCx/tLr1BtESIKyWWMww+RUqw==
version "1.1.3"
resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.3.tgz#fbb68696899d7b8c1b9b891eded9c04fe2cd5529"
integrity sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==

"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.11.3":
version "8.12.0"
Expand Down Expand Up @@ -5520,7 +5520,7 @@ cacheable-lookup@^5.0.3:
resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005"
integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==

cacheable-request@^7.0.1, cacheable-request@^7.0.2:
cacheable-request@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27"
integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==
Expand Down Expand Up @@ -5586,9 +5586,9 @@ camelize@^1.0.0:
integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=

caniuse-lite@^1.0.30001317:
version "1.0.30001397"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001397.tgz"
integrity sha512-SW9N2TbCdLf0eiNDRrrQXx2sOkaakNZbCjgNpPyMJJbiOrU5QzMIrXOVMRM1myBXTD5iTkdrtU/EguCrBocHlA==
version "1.0.30001480"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz"
integrity sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==

caseless@~0.12.0:
version "0.12.0"
Expand Down Expand Up @@ -7082,9 +7082,9 @@ del@^5.1.0:
slash "^3.0.0"

del@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/del/-/del-6.0.0.tgz#0b40d0332cea743f1614f818be4feb717714c952"
integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==
version "6.1.1"
resolved "https://registry.yarnpkg.com/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a"
integrity sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==
dependencies:
globby "^11.0.1"
graceful-fs "^4.2.4"
Expand Down Expand Up @@ -9423,7 +9423,7 @@ [email protected], got@^11.8.2:
"@types/cacheable-request" "^6.0.1"
"@types/responselike" "^1.0.0"
cacheable-lookup "^5.0.3"
cacheable-request "^7.0.1"
cacheable-request "^7.0.2"
decompress-response "^6.0.0"
http2-wrapper "^1.0.0-beta.5.2"
lowercase-keys "^2.0.0"
Expand Down