From 873d4323c4be87832cbf4010aad26745c8b19b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Thu, 9 May 2024 20:36:23 +0200 Subject: [PATCH 01/10] send message in pull request when test failed --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 139a9a57d..a827d7695 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,3 +26,10 @@ jobs: - name: Test run: npm test + + - name: Comment to PR + if: failure() && github.event_name == 'pull_request' + uses: thollander/actions-comment-pull-request@v1 + with: + message: "⚠️ Los tests han fallado. Por favor, revisa los cambios propuestos." + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a9c2a3d3e3f1550934311e3ed3a713e0c5c50490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Thu, 9 May 2024 20:38:15 +0200 Subject: [PATCH 02/10] send message in pull request when test failed --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a827d7695..dae425f4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: Comment to PR if: failure() && github.event_name == 'pull_request' - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: message: "⚠️ Los tests han fallado. Por favor, revisa los cambios propuestos." GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From eff76175814699adefed0f975dce6f0e420e577a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Thu, 9 May 2024 20:46:03 +0200 Subject: [PATCH 03/10] brake test --- tests/unit/SignIn.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/SignIn.spec.js b/tests/unit/SignIn.spec.js index b27526271..d5142e605 100644 --- a/tests/unit/SignIn.spec.js +++ b/tests/unit/SignIn.spec.js @@ -10,7 +10,7 @@ describe('SignIn', () => { it('should display email input', async () => { render(SignInView) - expect(screen.getByLabelText(/E-mail/i, { selector: 'input' })).toBeInTheDocument() + expect(screen.getByLabelText(/E-mailxxxxx/i, { selector: 'input' })).toBeInTheDocument() }) it('should display password input', async () => { render(SignInView) From 28ce3ab09a975a0f0e92d5b3026d6f4d10eecfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Thu, 9 May 2024 20:50:42 +0200 Subject: [PATCH 04/10] translate to english --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dae425f4b..6a26de9ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,5 +31,5 @@ jobs: if: failure() && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 with: - message: "⚠️ Los tests han fallado. Por favor, revisa los cambios propuestos." + message: "⚠️ The tests have failed. Please review the proposed changes." GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b10e0dee697e946da19e679853b302873a16d70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Thu, 9 May 2024 20:52:55 +0200 Subject: [PATCH 05/10] include autor in the message --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a26de9ea..1fef190cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,5 +31,5 @@ jobs: if: failure() && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 with: - message: "⚠️ The tests have failed. Please review the proposed changes." + message: "⚠️ The tests have failed, @${{ github.actor }}. Please review the proposed changes." GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3e2e99bfa4df936eb4499c5f051b9723f138dfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Sun, 19 May 2024 11:35:30 +0200 Subject: [PATCH 06/10] include discord message --- .github/workflows/test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fef190cd..3132ad27d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,5 +31,13 @@ jobs: if: failure() && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 with: - message: "⚠️ The tests have failed, @${{ github.actor }}. Please review the proposed changes." + message: "⚠️ The tests have failed, @${{ github.actor }} Please review the proposed changes." GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Send message to Discord + env: + DISCORD_WEBHOOK: 'https://discord.com/api/webhooks/1241683835067039784/1UkTaSTdthDJdYq_GSZRjAbCE8jLM0jMS6qvhYt8FuuuB6H1XGIYKzwfzQ7G-YImJTYE' + if: failure() && github.event_name == 'pull_request' + uses: Ilshidur/action-discord@master + with: + args: "⚠️ The github event ${{ github.event_name }} has failed. Please review the proposed changes." From 846be269ca667c14bde2a3c9bdb179ce5db942c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Sun, 19 May 2024 11:39:32 +0200 Subject: [PATCH 07/10] include more info discord message --- .github/workflows/test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3132ad27d..c039071b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,4 +40,12 @@ jobs: if: failure() && github.event_name == 'pull_request' uses: Ilshidur/action-discord@master with: - args: "⚠️ The github event ${{ github.event_name }} has failed. Please review the proposed changes." + args: | + ⚠️ The GitHub event `${{ github.event_name }}` has failed. + Repository: `${{ github.repository }}` + Workflow: `${{ github.workflow }}` + Job: `${{ github.job }}` + Commit: `${{ github.sha }}` + Actor: `${{ github.actor }}` + Pull Request: `${{ github.event.pull_request.html_url }}` + Please review the proposed changes. From ea8962eca7f3893212235e6f4218889cd5640298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Sun, 19 May 2024 11:44:10 +0200 Subject: [PATCH 08/10] include more info discord message --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c039071b7..1a4d38a90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,10 +42,10 @@ jobs: with: args: | ⚠️ The GitHub event `${{ github.event_name }}` has failed. - Repository: `${{ github.repository }}` - Workflow: `${{ github.workflow }}` - Job: `${{ github.job }}` - Commit: `${{ github.sha }}` - Actor: `${{ github.actor }}` - Pull Request: `${{ github.event.pull_request.html_url }}` + **Repository**: `${{ github.repository }}` + **Workflow**: `${{ github.workflow }}` + **Actor**: `${{ github.actor }}` + **Pull Request**: [Link](${{ github.event.pull_request.html_url }}) + **Action URL**: [View Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) Please review the proposed changes. + From 71ac02c6c9d1fc25f8b2416298ffa4cb5133db40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Sun, 19 May 2024 11:47:44 +0200 Subject: [PATCH 09/10] include secret in discord --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a4d38a90..b129af05f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: - name: Send message to Discord env: - DISCORD_WEBHOOK: 'https://discord.com/api/webhooks/1241683835067039784/1UkTaSTdthDJdYq_GSZRjAbCE8jLM0jMS6qvhYt8FuuuB6H1XGIYKzwfzQ7G-YImJTYE' + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} if: failure() && github.event_name == 'pull_request' uses: Ilshidur/action-discord@master with: From 45e755534e706744585a4cfcfcb29dd63affb1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Beltra=CC=81n?= Date: Sun, 19 May 2024 11:48:32 +0200 Subject: [PATCH 10/10] repair test --- tests/unit/SignIn.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/SignIn.spec.js b/tests/unit/SignIn.spec.js index d5142e605..b27526271 100644 --- a/tests/unit/SignIn.spec.js +++ b/tests/unit/SignIn.spec.js @@ -10,7 +10,7 @@ describe('SignIn', () => { it('should display email input', async () => { render(SignInView) - expect(screen.getByLabelText(/E-mailxxxxx/i, { selector: 'input' })).toBeInTheDocument() + expect(screen.getByLabelText(/E-mail/i, { selector: 'input' })).toBeInTheDocument() }) it('should display password input', async () => { render(SignInView)