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(grep): update cypress-grep references & docs & add e2e tests #24992

Closed
wants to merge 10 commits into from

Conversation

jordanpowell88
Copy link
Contributor

@jordanpowell88 jordanpowell88 commented Dec 6, 2022

User facing changelog

fix references still pointing to cypress-grep

Additional details

This PR also adds e2e tests as part of this lib

Steps to test

yarn workspace @cypress/grep test // unit tests
yarn workspace @cypress/grep cy:run // e2e tests

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 6, 2022

Thanks for taking the time to open a PR!

@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-grep branch from 7f1e4ec to a672f8f Compare December 6, 2022 14:29
@cypress
Copy link

cypress bot commented Dec 6, 2022

47 flaky tests on run #43567 ↗︎

0 26600 1274 0 Flakiness 47

Details:

chore: update grep test command
Project: cypress Commit: b57a19684c
Status: Passed Duration: 19:37 💡
Started: Jan 30, 2023 3:02 PM Ended: Jan 30, 2023 3:22 PM
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
network stubbing > intercepting request > can delay and throttle a StaticResponse
Flakiness  e2e/origin/commands/navigation.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
cy.origin navigation > #consoleProps > .go()
Flakiness  e2e/origin/commands/waiting.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
cy.origin waiting > alias > waits for the route alias to have a response
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary
Flakiness  e2e/origin/commands/assertions.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test
cy.origin assertions > #consoleProps > .should() and .and()

The first 5 flaky specs are shown, see all 25 specs in Cypress Cloud.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Contributor

@jaffrepaul jaffrepaul left a comment

Choose a reason for hiding this comment

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

Left one comment about addAxeCode.

Didn't have the bandwidth to test run this, but otherwise looks straight forward.

npm/grep/scripts.js Outdated Show resolved Hide resolved
@jordanpowell88
Copy link
Contributor Author

I updated to using system-tests using the strategy @ZachJW34 implemented on @cypress/schematic

@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-grep branch from 00d9cc4 to 0aeb3f1 Compare December 9, 2022 18:53
"name": "grep",
"version": "0.0.0",
"devDependencies": {
"cypress": "latest",
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be installing Cypress but testing against the binary.

Comment on lines 36 to 38
it('run Unit Tests', async () => {
await runCommandInProject('npx cypress run --spec cypress/e2e/unit.js --config specPattern="**/unit.js"', projectPath)
})
Copy link
Member

Choose a reason for hiding this comment

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

there should not be unit tests in system-tests. These should live in npm/grep

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

await runCommandInProject(`npx cypress-expect --min-passing 5 --pending 0`, projectPath)
})

it('Run e2e skip tests without grep 🧪', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I would expect these system tests to be modeled like the other system-tests in Cypress for maintainability purposes. If we need to make enhancements to support checking the report output, I think that'd be better than adding dozens of json files with the test results don't live with the test. At a min, this need to be running against the binary and not using npx in these tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that the plugin needs the cypress module, and it can't resolve without it. It is the same issue we have with @cypress/schematics. This is why we have to move the system tests to a temp dir to run

Copy link
Member

Choose a reason for hiding this comment

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

@jordanpowell88 What do you mean exactly? Because it's listed as a peerDependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it needs cypress as a peerDep but it also needs cypress as a devDep

Copy link
Member

Choose a reason for hiding this comment

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

Looking how this is setup though, that's because of cypress-expect right? which I why I am wondering if that's the right tool if we are unable to setup the system-tests to use the just-built binary. It looks like this is just a wrapper around running cypress programmatically to return the test results. We can pull the cypress output from systemTests.it to determine the tests that ran and how many passed & failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, we can do this but this would be a bigger lift than we are wanting to do at this moment

@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-grep branch 2 times, most recently from 3a225d0 to daa400d Compare December 13, 2022 14:56
@lmiller1990
Copy link
Contributor

@jordanpowell88 and you re-ping when this is ready to review? 🙏

@Narretz
Copy link
Contributor

Narretz commented Jan 30, 2023

Are there any updates for this @jordanpowell88 ?

@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-grep branch from 7e45cf4 to c502d86 Compare January 30, 2023 14:02
@Narretz
Copy link
Contributor

Narretz commented Feb 27, 2023

Hi @jordanpowell88 I hate to be that person, but is there any news here?

@Narretz
Copy link
Contributor

Narretz commented Mar 7, 2023

Hi @jordanpowell88 I go the notification that this issue is closed, but the code hasn't been merged. Will the work continue in another PR?

@lmiller1990
Copy link
Contributor

lmiller1990 commented Mar 8, 2023

Let me find out for you. We should decide what's happening with cypress-grep moving forward.

@jordanpowell88
Copy link
Contributor Author

@Narretz re-opened this PR (without the tests) #26108

@Narretz
Copy link
Contributor

Narretz commented Mar 14, 2023

Thanks @jordanpowell88

What's with the tests, though? Will they be added in a separate PR?

@jordanpowell88
Copy link
Contributor Author

jordanpowell88 commented Mar 15, 2023

This will be up the @cypress-io/end-to-end team to create a follow issue around this as they are now responsible for handling the @cypress/grep package. Feel free to create an issue as well

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