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

fix: inconsistent timezones in e2e tests #11841

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

zomars
Copy link
Member

@zomars zomars commented Oct 11, 2023

What does this PR do?

refs #2337

Up until recently, running e2e tests locally didn't take into account local timezones. Now it seems like it is and is triggering the update timezone popup, getting tests to timeout.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

On a browser with a different timezone (like America/Mazatlan), run e2e tests. The popup should not appear.

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@zomars
Copy link
Member Author

zomars commented Oct 11, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@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 16, 2023 11:30pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 11:30pm
cal 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 11:30pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 11:30pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 11:30pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2023 11:30pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
qa ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2023 11:30pm

@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

✅ 162 Passing - ⚠️ 3 Flaky

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

(Last updated on 10/16/2023 11:33:33pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 349d8c0

Started: 10/16/2023 11:30:58pm UTC

⚠️ Flakes

📄   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 be able to reschedule
Retry 2Retry 1Initial Attempt
7.85% (26) 26 / 331 runs
failed over last 7 days
90.94% (301) 301 / 331 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1Initial Attempt
3.31% (11) 11 / 332 runs
failed over last 7 days
37.35% (124) 124 / 332 runs
flaked over last 7 days

📄   apps/web/playwright/profile.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams Profile page is loaded for users in Organization
Retry 1Initial Attempt
1.62% (5) 5 / 309 runs
failed over last 7 days
28.80% (89) 89 / 309 runs
flaked over last 7 days

View Detailed Build Results


PeerRich
PeerRich previously approved these changes Oct 11, 2023
emrysal
emrysal previously approved these changes Oct 14, 2023
Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

Nice one zomars 🚀

@emrysal emrysal enabled auto-merge (squash) October 14, 2023 14:21
import stripe from "@calcom/features/ee/payments/server/stripe";
import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/availability";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { prisma } from "@calcom/prisma";
import { MembershipRole, SchedulingType } from "@calcom/prisma/enums";

import { selectFirstAvailableTimeSlotNextMonth, teamEventSlug, teamEventTitle } from "../lib/testUtils";
import type { TimeZoneEnum } from "./types";
import { TimeZoneEnum } from "./types";
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think we should move TimeZoneEnum from types to somewhere else as it's not just a type, a value also.

import { prisma } from "@calcom/prisma";

const translator = short();

type BookingFixture = ReturnType<typeof createBookingFixture>;

// We default all dayjs calls to use Europe/London timezone
const dayjs = (...args: Parameters<typeof _dayjs>) => _dayjs(...args).tz("Europe/London");
Copy link
Member

Choose a reason for hiding this comment

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

nit: We could use Timezone.UK here also.

Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

LGTM!!

@emrysal emrysal merged commit d46e80c into main Oct 17, 2023
@emrysal emrysal deleted the 10-11-fix_inconsistent_timezones_in_e2e_tests branch October 17, 2023 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working core area: core, team members only High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants