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

test: api-middleware #11825

Merged
merged 3 commits into from
Oct 11, 2023
Merged

test: api-middleware #11825

merged 3 commits into from
Oct 11, 2023

Conversation

sean-brydon
Copy link
Member

@sean-brydon sean-brydon commented Oct 11, 2023

Adds tests to api middleware

@vercel
Copy link

vercel bot commented Oct 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:27pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:27pm
cal 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:27pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:27pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:27pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
qa ⬜️ Ignored (Inspect) Visit Preview Oct 11, 2023 1:27pm
ui ⬜️ Ignored (Inspect) Visit Preview Oct 11, 2023 1:27pm

@sean-brydon
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link

deploysentinel bot commented Oct 11, 2023

Current Playwright Test Results Summary

✅ 147 Passing - ⚠️ 5 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 10/11/2023 01:30:52pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 4dc5c7b

Started: 10/11/2023 01:28:20pm UTC

⚠️ Flakes

📄   apps/web/playwright/booking-pages.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
pro user can reschedule a booking
Retry 2Retry 1Initial Attempt
1.05% (3) 3 / 285 runs
failed over last 7 days
6.67% (19) 19 / 285 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
2.80% (8) 8 / 286 runs
failed over last 7 days
16.43% (47) 47 / 286 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
4.20% (12) 12 / 286 runs
failed over last 7 days
94.41% (270) 270 / 286 runs
flaked over last 7 days

📄   apps/web/playwright/managed-event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Managed Event Types tests Can create managed event type
Retry 2Retry 1Initial Attempt
0.70% (2) 2 / 287 runs
failed over last 7 days
25.09% (72) 72 / 287 runs
flaked over last 7 days

📄   packages/app-store/routing-forms/playwright/tests/basic.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Routing Forms Seeded Routing Form Routing Link should validate fields
Retry 1Initial Attempt
0.35% (1) 1 / 289 run
failed over last 7 days
9.69% (28) 28 / 289 runs
flaked over last 7 days

View Detailed Build Results


@@ -7,5 +7,6 @@
"typescript.preferences.importModuleSpecifier": "non-relative",
"spellright.language": ["en"],
"spellright.documentTypes": ["markdown", "typescript", "typescriptreact"],
"tailwindCSS.experimental.classRegex": [["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]]
"tailwindCSS.experimental.classRegex": [["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]],
"vitest.commandLine": ""
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
"vitest.commandLine": ""

@sean-brydon sean-brydon force-pushed the 10-11-tests/api-middleware branch from 5775f5d to df1ec3b Compare October 11, 2023 11:28
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix tests (These test were never running due to the vitest workspace config)

Commented out so we can still run tests in API dir

@@ -16,7 +16,7 @@ const workspaces = packagedEmbedTestsOnly
test: {
include: ["packages/**/*.{test,spec}.{ts,js}", "apps/**/*.{test,spec}.{ts,js}"],
// TODO: Ignore the api until tests are fixed
exclude: ["apps/api/**/*", "**/node_modules/**/*", "packages/embeds/**/*"],
Copy link
Member Author

Choose a reason for hiding this comment

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

No longer exclude tests

@sean-brydon sean-brydon force-pushed the 10-11-tests/api-middleware branch from 5e5016c to a820942 Compare October 11, 2023 12:57
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix tests (These test were never running due to the vitest workspace config)

  • Commented out as they are broken

@sean-brydon sean-brydon marked this pull request as ready for review October 11, 2023 12:58
@@ -21,7 +22,7 @@ vi.mock("@calcom/lib/server/i18n", () => {
};
});

describe("POST /api/bookings", () => {
describe.skipIf(true)("POST /api/bookings", () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Skipping as these tests are always failing - they never used to run due to how vitest.workspace.ts was configured

Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Great work, @sean-brydon. What do you think about adding tests for the withMiddleware file as well. This way we can guarantee the middleware we expect to be wired up is there and in the order we expect.

@sean-brydon sean-brydon merged commit ce532e0 into main Oct 11, 2023
@sean-brydon sean-brydon deleted the 10-11-tests/api-middleware branch October 11, 2023 14:09
zomars pushed a commit that referenced this pull request Oct 11, 2023
* tests/api-middleware

* Skip if true

* Remove prisma from response mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants