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

feat: init e2e workflow setup #1086

Merged
merged 17 commits into from
Oct 12, 2024
Merged

feat: init e2e workflow setup #1086

merged 17 commits into from
Oct 12, 2024

Conversation

pkspyder007
Copy link
Collaborator

✨ Codu Pull Request 💻

Fixes #(issue)

  • NA

Pull Request details

  • Created a workflow to run e2e tests under e2e env with pre-seeded db and github app setup
  • Requires few secrets to to added for db and github app setup

Any Breaking changes

  • None

Associated Screenshots

  • None

@pkspyder007 pkspyder007 requested a review from a team as a code owner October 7, 2024 16:57
Copy link
Contributor

coderabbitai bot commented Oct 7, 2024

Walkthrough

The playwright.config.ts file has been updated to change the command property in the webServer section from "npm run dev" to "npm run dev:e2e", which modifies the command used to start the local development server for end-to-end testing. The entry for "Mobile Chrome" in the projects array has been commented out, and an outputDir property has been added to specify 'playwright-report' as the directory for test outputs. In addition, the test suite in e2e/articles.spec.ts has been disabled by changing test.describe to test.skip.

Changes

File Change Summary
playwright.config.ts Updated webServer.command from "npm run dev" to "npm run dev:e2e", added outputDir: 'playwright-report', and commented out "Mobile Chrome" project entry.
e2e/articles.spec.ts Modified test suite from test.describe("Articles", ...) to test.skip("Articles", ...), disabling the entire suite.

Possibly related PRs

  • fix: update e2e tests for newer changes in site #1085: The changes in the e2e/home.spec.ts file involve modifications to the test suite that may relate to the overall testing strategy, similar to the updates made in the e2e/articles.spec.ts file where the test suite was disabled. Both PRs involve adjustments to test configurations and suites, indicating a potential connection in the context of end-to-end testing.

Suggested reviewers

  • NiallJoeMaher

Poem

In the land of code where rabbits play,
A new command leads the way.
From dev to dev:e2e, we hop,
Testing our features, we won't stop!
With each little change, our code will grow,
In the garden of scripts, watch us glow! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 19d6664 and d385591.

📒 Files selected for processing (1)
  • playwright.config.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • playwright.config.ts

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

vercel bot commented Oct 7, 2024

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

Name Status Preview Comments Updated (UTC)
codu ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2024 6:55am

@pkspyder007
Copy link
Collaborator Author

The tests will start passing once this PR merged and rebased into the e2e workflow branched

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
playwright.config.ts (1)

Line range hint 1-80: Consider additional e2e setup requirements

  1. The PR objectives mention adding secrets for the database and GitHub application setup. Ensure these secrets are properly configured in the appropriate place (e.g., GitHub Secrets, environment variables) for the e2e workflow to function correctly.

  2. The baseURL is currently commented out in the configuration. Consider uncommenting and setting it to the appropriate URL for your e2e tests:

use: {
  /* Base URL to use in actions like `await page.goto('/')`. */
  baseURL: 'http://127.0.0.1:3000',
  // ...
},

This can help simplify your test scripts by allowing you to use relative paths in your page.goto() calls.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0cadee6 and ad66dd4.

⛔ Files ignored due to path filters (2)
  • .github/workflows/e2e-tests.yml is excluded by !**/*.yml
  • package.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • playwright.config.ts (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
playwright.config.ts (1)

74-74: LGTM: Updated command for e2e testing environment

The change from "npm run dev" to "npm run dev:e2e" aligns with the PR objective of setting up an e2e testing workflow. This modification ensures that the correct environment is used for end-to-end testing.

To ensure this change is properly integrated, let's verify the existence and content of the dev:e2e script:

✅ Verification successful

Verified: dev:e2e script exists and is correctly configured

The dev:e2e script is present in package.json with the expected configuration. This ensures that the Playwright setup in playwright.config.ts uses the appropriate environment for end-to-end testing.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and content of the dev:e2e script in package.json

# Test: Check if the dev:e2e script exists in package.json
jq '.scripts["dev:e2e"]' package.json

# If the script exists, its content will be displayed. If it doesn't exist, null will be returned.

Length of output: 58

@pkspyder007
Copy link
Collaborator Author

@NiallJoeMaher @John-Paul-Larkin
I am not having access to add secrets to the repo, if any of you could create a new supabase instance and add the
E2E_DATABASE_URL in the secret we'll have a persistent E2E DB

Also we need to create github oauth client for testing github auth flows
That will require similar secrets please refer to the workflow implementaion

@pkspyder007 pkspyder007 closed this Oct 7, 2024
@pkspyder007 pkspyder007 reopened this Oct 7, 2024
@NiallJoeMaher
Copy link
Contributor

@pkspyder007 - Do you think we should use an e2e database url or just give it a database URL it can use instead (rather than having a separate one). Eg. if we used DATABASE_URL would there be any issue?

@pkspyder007
Copy link
Collaborator Author

@pkspyder007 - Do you think we should use an e2e database url or just give it a database URL it can use instead (rather than having a separate one). Eg. if we used DATABASE_URL would there be any issue?

@NiallJoeMaher The current setup uses DATABASE_URL only I have just named secret to have E2E in the name so its clear to understand what this DB url exactly is.
Our E2E_DATABASE_URL will contain link to a postgres db with seeded data.

@pkspyder007 pkspyder007 closed this Oct 7, 2024
@pkspyder007 pkspyder007 reopened this Oct 7, 2024
@pkspyder007
Copy link
Collaborator Author

Also wanna add that running a docker image will utilise more resource and cost us more and lead to increased the CI times.

@praveen-quizizz
Copy link

@NiallJoeMaher have a look whenever you get time

few action items

  • check for login test flakiness
  • fix seeding
  • updating and revamping skipped tests
  • move tests results to report on PR and host traces to something like S3

Copy link
Contributor

@NiallJoeMaher NiallJoeMaher left a comment

Choose a reason for hiding this comment

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

🌮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants