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

[CI] Cypress test run spec input #5142

Merged
Merged
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
15 changes: 9 additions & 6 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ on:
required: false
type: number
specs:
description: 'Additional tests to run'
description: 'Tests to run (default: core)'
default: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,'
required: false
type: string

env:
SOURCE_REPO: ${{ github.repository }}
SOURCE_BRANCH: ${{ github.base_ref }}
SOURCE_BRANCH: "${{ github.base_ref }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - it looks like prefer single quotes elsewhere in this yml file?

TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
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,'
ADDITIONAL_SPEC: ${{ inputs.specs != '' && inputs.specs || '' }}
SPEC: ${{ inputs.specs != '' && inputs.specs || 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' }}
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
working-directory: ${{ env.FTR_PATH }}
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}${{ env.ADDITIONAL_SPEC }}
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}

# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -180,10 +180,13 @@ jobs:
#### Inputs:
Source repo: `${{ env.SOURCE_REPO }}`
Source branch: `${{ env.SOURCE_BRANCH }}`
Source branch: ``${{ env.SOURCE_BRANCH }}``
Test repo: `${{ env.TEST_REPO }}`
Test branch: ``${{ env.TEST_BRANCH }}``
Test spec:
`${{ env.SPEC }}`
#### Link to results:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
edit-mode: replace
Loading