-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from Windesheim-AI-App/task/update-tests-in-cicd
chore: 🚧 Optimize E2E tests in CI/CD
- Loading branch information
Showing
10 changed files
with
141 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ instrument/ | |
*.md | ||
package-lock.json | ||
|
||
./fonts.js | ||
fonts.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: cleanup-action | ||
description: test action | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: 'Remove env file' | ||
shell: bash | ||
run: | | ||
rm .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: prepare-action | ||
description: Prepare build | ||
|
||
inputs: | ||
openai-api-key: | ||
description: 'The OpenAI API key' | ||
required: true | ||
app-debug: | ||
description: 'If the debug mode is enabled' | ||
required: true | ||
wp-username: | ||
description: 'The WordPress username' | ||
required: true | ||
wp-password: | ||
description: 'The WordPress password' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: 'Create & configure env file' | ||
shell: bash | ||
run: | | ||
touch .env | ||
echo OPENAI_API_KEY=${{ inputs.openai-api-key }} >> .env | ||
echo APP_DEBUG=${{ inputs.app-debug }} >> .env | ||
echo AI_ENABLED="false" >> .env | ||
echo WP_CONTENT_URL="https://www.windesheim.tech" >> .env | ||
echo WP_DATA_URL="https://www.windesheim.ai" >> .env | ||
echo WP_USERNAME=${{ inputs.wp-username }} >> .env | ||
echo WP_PASSWORD=${{ inputs.wp-password }} >> .env | ||
cat .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: End to end tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
jobs: | ||
tests: | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
test-platform: [firefox, electron] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/prepare-action | ||
with: | ||
openai-api-key: ${{ secrets.OPENAI_API_KEY }} | ||
app-debug: false | ||
wp-username: ${{ secrets.WP_USERNAME }} | ||
wp-password: ${{ secrets.WP_PASSWORD }} | ||
|
||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
start: npm run web | ||
browser: ${{ matrix.test-platform }} | ||
|
||
- uses: ./.github/cleanup-action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
describe('wait for server', () => { | ||
it('waits for server', () => { | ||
// Wait for the server to start up | ||
cy.wait(30_000); | ||
it('waits for server', { retries: 3 }, () => { | ||
cy.visit('/'); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ | |
"app.config.ts", | ||
"metro.config.js" | ||
], | ||
"exclude": ["cypress/*"] | ||
"exclude": ["cypress/*", "node_modules/*"] | ||
} |