Skip to content

Commit

Permalink
Create issue if e2e tests fail after deployment (#24)
Browse files Browse the repository at this point in the history
* Add various issue templates

* Create issue when e2e tests fail after deployment

* Force e2e tests to fail temporarily
  • Loading branch information
jtreeves authored Mar 18, 2024
1 parent 57fcb94 commit 4b363d7
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/1_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Bug Report
description: Create a new ticket for a bug
labels: ['bug']
assignees:
- jtreeves
body:
- type: markdown
attributes:
value: 'Please read and follow the instructions before submitting an issue:'
- type: markdown
attributes:
value: |
- Read all our documentation, especially the [README](https://github.com/jtreeves/read-this-next)
- Ensure the bug has not already been [reported](https://github.com/jtreeves/read-this-next/labels/bug)
- type: textarea
id: problem
attributes:
label: Problem
description: What went wrong?
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What did you expect to happen?
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: Browsers
description: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/jtreeves/read-this-next?tab=coc-ov-file#readme)
options:
- label: I agree to follow this project's Code of Conduct
required: true
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/2_feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Feature Request
description: Create a new ticket for a feature request
labels: ['enhancement']
assignees:
- jtreeves
body:
- type: markdown
attributes:
value: 'Please read and follow the instructions before submitting an issue:'
- type: markdown
attributes:
value: |
- Read all our documentation, especially the [README](https://github.com/jtreeves/read-this-next)
- Ensure the feature has not already been [requested](https://github.com/jtreeves/read-this-next/labels/enhancement)
- type: textarea
id: proposal
attributes:
label: Proposal
description: What would you like to happen?
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives
description: What other solutions have you attempted?
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/jtreeves/read-this-next?tab=coc-ov-file#readme)
options:
- label: I agree to follow this project's Code of Conduct
required: true
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/3_ask_question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Ask a Question
description: Create a new ticket to ask a question
labels: ['question']
assignees:
- jtreeves
body:
- type: markdown
attributes:
value: 'Please read and follow the instructions before submitting an issue:'
- type: markdown
attributes:
value: |
- Read all our documentation, especially the [README](https://github.com/jtreeves/read-this-next)
- Ensure the question has not already been [asked](https://github.com/jtreeves/read-this-next/labels/question)
- type: textarea
id: question
attributes:
label: Question
description: What topic would you like to discuss?
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: Can you provide any additional context to help us understand your question?
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/jtreeves/read-this-next?tab=coc-ov-file#readme)
options:
- label: I agree to follow this project's Code of Conduct
required: true
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/4_test_failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Report Test Failure
description: Create a new ticket to report a test failure
title: 'Failure occurred when running e2e tests'
labels: ['tests']
assignees:
- jtreeves
body:
- type: markdown
attributes:
value: 'One or more end-to-end tests failed after the latest deployment.'
10 changes: 10 additions & 0 deletions .github/workflows/post_deploy_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30
issue-creation:
runs-on: ubuntu-latest
needs: e2e-tests
if: failure()
steps:
- uses: actions/checkout@v3
- name: Create issue
run: |
echo "Tests failed; creating issue"
cat ISSUE_TEMPLATE/4_test_failure.yml | github-issue create
2 changes: 1 addition & 1 deletion tests/browse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ test.describe('browse', () => {
test('should have title of browse', async ({ page }) => {
await page.goto('/browse')

await expect(page).toHaveTitle(/Browse/)
await expect(page).toHaveTitle(/NOT Browse/)
})
})

0 comments on commit 4b363d7

Please sign in to comment.