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: support Angular 16.1 #27030

Closed

Conversation

leosvelperez
Copy link
Contributor

@leosvelperez leosvelperez commented Jun 14, 2023

Additional details

In Angular 16.1, some internal files' locations consumed by the Cypress Angular handler changed. This causes Cypress to error with:

Your configFile threw an error from: cypress.config.ts

We stopped running your tests because your config file crashed.

Error: Could not resolve "@angular-devkit/build-angular/src/webpack/configs/common.js". Do you have "@angular-devkit/build-angular" and "@angular-devkit/core" installed?
...

For reference, this is the commit in the Angular CLI where the change was made: angular/angular-cli@466d86d

Steps to test

How has the user experience changed?

PR Tasks

@cypress-app-bot
Copy link
Collaborator

@leosvelperez leosvelperez marked this pull request as ready for review June 14, 2023 10:07
@cypress
Copy link

cypress bot commented Jun 14, 2023

2 failed and 29 flaky tests on run #47826 ↗︎

2 27217 1307 0 Flakiness 29

Details:

feat: support Angular 16.1
Project: cypress Commit: f9e281c1d1
Status: Failed Duration: 14:48 💡
Started: Jun 16, 2023 4:20 PM Ended: Jun 16, 2023 4:35 PM
Failed  scaffold-project.cy.ts • 1 failed test • launchpad-e2e

View Output Video

Test Artifacts
scaffolding new projects > generates valid config file for pristine project without cypress installed Output Screenshots Video
Failed  commands/querying/querying.cy.js • 1 failed test • 5x-driver-webkit

View Output Video

Test Artifacts
... > throws when alias property isnt just a digit Output Video
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output Video
Flakiness  commands/waiting.cy.js • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
... > errors > throws when waiting for 2nd response to route Output Video
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron

View Output Video

Test Artifacts
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

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

View Output Video

Test Artifacts
basic login > visit primary first > does not redirect Output

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

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

@leosvelperez leosvelperez marked this pull request as draft June 14, 2023 10:39
@leosvelperez leosvelperez force-pushed the feat/angular-16.1-support branch from 6fe4440 to d9a15a7 Compare June 14, 2023 10:51
@leosvelperez leosvelperez marked this pull request as ready for review June 14, 2023 10:53
@leosvelperez
Copy link
Contributor Author

@jordanpowell88 @lmiller1990 The pipeline didn't run and Circle CI is showing this notice in the workflow: The user who triggered the build may not have permission to a context being used. Visit our help article, [Troubleshooting Builds "Unauthorized" due to contexts](https://support.circleci.com/hc/en-us/articles/360050273651-Builds-Unauthorized-due-to-contexts).

Is there anything I should do to unblock this? Or is this something you can help me with?

@lmiller1990
Copy link
Contributor

Hi @leosvelperez, I think I need to kick off the pipeline, since you are an external contributor. I'll do that now, and give your code a review.

@@ -195,6 +208,15 @@ export async function getAngularCliModules (projectRoot: string) {
}
}

async function getInstalledPackageVersion (pkgName: string, projectRoot: string): Promise<string> {
const packageJsonPath = require.resolve(`${pkgName}/package.json`, { paths: [projectRoot] })
Copy link
Contributor

Choose a reason for hiding this comment

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

Just had to double check, but this looks fine - some packages do not expose package.json, but this one does: https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/core/package.json#L23

@@ -165,10 +166,22 @@ export async function getTempDir (): Promise<string> {
}

export async function getAngularCliModules (projectRoot: string) {
let angularVersion: string
Copy link
Contributor

Choose a reason for hiding this comment

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

The code looks reasonable. I'd like to see an End to End testing verifying Angular 16.1 is working - can you add one here? https://github.com/cypress-io/cypress/blob/develop/npm/webpack-dev-server/cypress/e2e/angular.cy.ts#L5

Just follow the existing patterns, you can add a new Angular 16.1 project. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the E2E project for Angular 16.1. It seems you'll need to kick off the pipeline again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Doing this now.

@leosvelperez
Copy link
Contributor Author

hey @lmiller1990! Thanks for the review!

Is there anything I can do to unblock this? I'm unsure if the failing checks are related to my change, but it doesn't look like it.

@lmiller1990
Copy link
Contributor

hey @lmiller1990! Thanks for the review!

Is there anything I can do to unblock this? I'm unsure if the failing checks are related to my change, but it doesn't look like it.

Looks good now. I'll get this one merged up for you.

It'll be in the next release, which will be in 2 weeks (we release every 2 weeks). That'll be early July.

@lmiller1990
Copy link
Contributor

Got some unrelated flake. Please give me another day, I'll get this green and merged up.

@leosvelperez
Copy link
Contributor Author

@lmiller1990 thanks!

It'll be in the next release, which will be in 2 weeks (we release every 2 weeks). That'll be early July.

Is there any way this could be released earlier than that?

Releasing in 2 weeks means Angular projects (both with Angular CLI and NX) using Cypress component testing will be hit with this error. Given the Angular 16.1.0 release was over a week ago, that's a total of 3 weeks where folks can't update or can't create new Angular projects using Cypress component testing.

@jordanpowell88 jordanpowell88 force-pushed the feat/angular-16.1-support branch from 268d344 to 392ae5f Compare June 21, 2023 19:52
@lmiller1990
Copy link
Contributor

lmiller1990 commented Jun 21, 2023

@lmiller1990 thanks!

It'll be in the next release, which will be in 2 weeks (we release every 2 weeks). That'll be early July.

Is there any way this could be released earlier than that?

Releasing in 2 weeks means Angular projects (both with Angular CLI and NX) using Cypress component testing will be hit with this error. Given the Angular 16.1.0 release was over a week ago, that's a total of 3 weeks where folks can't update or can't create new Angular projects using Cypress component testing.

I can surface this internally, we don't generally do off cycle releases for issues outside of major regressions - I cannot commit to this right now, since releasing a new version takes the best part of a day, but maybe we can make it happen. It definitely won't be until next week, though, at the earliest -- doing a release is a bit more involved (more than we'd probably like it to be).

Great to see the Angular community is so proactive with fixing/patching things to the latest version! Thank you for this, I'll try to get it merged (again) today.

@lmiller1990
Copy link
Contributor

I think your branch/container is cursed 👻

I remade it and it passed CI first time: #27106

Let's use that PR, it's ready to go - can you add yourself as a reviewer and approve @leosvelperez ?

@lmiller1990
Copy link
Contributor

Close in favor of #27106

All commits maintained, should be fine.

@lmiller1990 lmiller1990 mentioned this pull request Jun 21, 2023
3 tasks
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.

Cypress 12.4.0 does not work with @angular-devkit/build-angular 16.1.0
6 participants