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

chore: fix cypress npm package artifact upload path #20023

Merged
merged 13 commits into from
Feb 4, 2022

Conversation

emilyrohrbough
Copy link
Member

The upload-npm-package and upload-unique-bindary scripts are aligned with this changes into a single scripts upload-build-artifacts.

User facing changelog

n/a

How has the user experience changed?

Ensures cypress npm package is distributed with the correct line endings.

PR Tasks

  • Have tests been added/updated?
  • [n/a] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?
  • [n/a] Have new configuration options been added to the cypress.schema.json?

@emilyrohrbough emilyrohrbough requested a review from a team as a code owner February 2, 2022 19:47
@emilyrohrbough emilyrohrbough requested review from cypress-github-team-services-sa and removed request for a team February 2, 2022 19:47
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 2, 2022

Thanks for taking the time to open a PR!

@@ -93,14 +87,15 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
- To find the link to the package file `cypress.tgz`:
1. In GitHub, go to the latest commit (the one whose sha you used in the last step).
![commit-link](https://user-images.githubusercontent.com/1157043/80608728-33fe6100-8a05-11ea-8b53-375303757b67.png)
2. Scroll down past the changes to the comments. The first comment should be a `cypress-bot` comment that includes a line beginning `npm install ...`. Grab the `https://cdn.../npm/X.Y.Z/<long sha>/cypress.tgz` link.
2. Scroll down past the changes to the comments. The first comment should be a `cypress-bot` comment that includes a line beginning `npm install ...`. Grab the `https://cdn.../npm/X.Y.Z/<platform>/<long sha>/cypress.tgz` link.
![cdn-tgz-link](https://user-images.githubusercontent.com/1157043/80608736-3791e800-8a05-11ea-8d75-e4f80128e857.png)
Copy link
Member Author

Choose a reason for hiding this comment

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

This image should be updated (show incorrect npm package path). How do you upload to https://user-images.githubusercontent.com?

Copy link
Contributor

Choose a reason for hiding this comment

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

Those are from pasting in GitHub comments, but maybe it would be better if they were in the repo itself. You can add the image in /assets or /guides/images or something.

@emilyrohrbough emilyrohrbough changed the title chore: fix build artifact upload path chore: fix cypress npm package artifact upload path Feb 2, 2022
@cypress
Copy link

cypress bot commented Feb 2, 2022



Test summary

19177 0 218 0Flakiness 1


Run details

Project cypress
Status Passed
Commit aca2e18
Started Feb 4, 2022 5:03 PM
Ended Feb 4, 2022 5:14 PM
Duration 11:51 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

It seems like getBinaryUrlFromPrereleaseNpmUrl needs to be updated in the CLI, so install can discover the correct binary .zip for a given prerelease .tgz.

// convert a prerelease NPM package .tgz URL to the corresponding binary .zip URL
const getBinaryUrlFromPrereleaseNpmUrl = (npmUrl) => {
let parsed
try {
parsed = url.parse(npmUrl)
} catch (e) {
return
}
const matches = betaNpmUrlRe.exec(parsed.pathname)
if (parsed.hostname !== 'cdn.cypress.io' || !matches) {
return
}
const { version, artifactSlug } = matches.groups
parsed.pathname = `/beta/binary/${version}/${os.platform()}-${os.arch()}/${artifactSlug}/cypress.zip`
return parsed.format()
}

➜  ~ npm install -g https://cdn.cypress.io/beta/npm/9.4.2/linux-x64/circle-fix-ci-artifact-uploads-403552989ac9ba5e9547ab56b7d58ee65b8b5502/cypress.tgz
npm ERR! code 1
npm ERR! path /home/flotwig/.nvm/versions/node/v16.5.0/lib/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! ⚠ Warning: Forcing a binary version different than the default.
npm ERR! 
npm ERR!   The CLI expected to install version: 9.4.2
npm ERR! 
npm ERR!   Instead we will install version: https://cdn.cypress.io/beta/binary/9.4.2/linux-x64/linux-x64/circle-fix-ci-artifact-uploads-403552989ac9ba5e9547ab56b7d58ee65b8b5502/cypress.zip
npm ERR! 
npm ERR!   These versions may not work properly together.
npm ERR! 
npm ERR! Installing Cypress (version: https://cdn.cypress.io/beta/binary/9.4.2/linux-x64/linux-x64/circle-fix-ci-artifact-uploads-403552989ac9ba5e9547ab56b7d58ee65b8b5502/cypress.zip)
npm ERR! 
npm ERR! [STARTED] Task without title.
npm ERR! The Cypress App could not be downloaded.
npm ERR! 
npm ERR! Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
npm ERR! 
npm ERR! Otherwise, please check network connectivity and try again:
npm ERR! 
npm ERR! ----------
npm ERR! 
npm ERR! URL: https://cdn.cypress.io/beta/binary/9.4.2/linux-x64/linux-x64/circle-fix-ci-artifact-uploads-403552989ac9ba5e9547ab56b7d58ee65b8b5502/cypress.zip
npm ERR! Error: Failed downloading the Cypress binary.
npm ERR! Response code: 404
npm ERR! Response message: Not Found
npm ERR! 
npm ERR! ----------
npm ERR! 
npm ERR! Platform: linux-x64 (Ubuntu - )
npm ERR! Cypress Version: 9.4.2
npm ERR! [FAILED] The Cypress App could not be downloaded.
npm ERR! [FAILED] 
npm ERR! [FAILED] Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
npm ERR! [FAILED] 
npm ERR! [FAILED] Otherwise, please check network connectivity and try again:
npm ERR! [FAILED] 
npm ERR! [FAILED] ----------
npm ERR! [FAILED] 
npm ERR! [FAILED] URL: https://cdn.cypress.io/beta/binary/9.4.2/linux-x64/linux-x64/circle-fix-ci-artifact-uploads-403552989ac9ba5e9547ab56b7d58ee65b8b5502/cypress.zip
npm ERR! [FAILED] Error: Failed downloading the Cypress binary.
npm ERR! [FAILED] Response code: 404
npm ERR! [FAILED] Response message: Not Found
npm ERR! [FAILED] 
npm ERR! [FAILED] ----------
npm ERR! [FAILED] 
npm ERR! [FAILED] Platform: linux-x64 (Ubuntu - )
npm ERR! [FAILED] Cypress Version: 9.4.2

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/flotwig/.npm/_logs/2022-02-03T16_57_31_125Z-debug.log

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

nice!

@mjhenkes mjhenkes self-requested a review February 3, 2022 19:05
tgriesser added a commit that referenced this pull request Feb 4, 2022
* develop:
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)
tgriesser added a commit that referenced this pull request Feb 4, 2022
…r/error-improvements

* tgriesser/chore/refactor-errors: (60 commits)
  fix: build @packages/errors in CI, defer import to prevent errors locally
  chore: fix cypress npm package artifact upload path (#20023)
  pass the browsers to listItems
  Link in readme
  fixing ci
  fix assertion
  remove concurrency
  store snapshot html
  remove snapshot images
  do not do image diffing
  fix tests
  add flag
  disable app hardware acceleration + use in process gpu + single process
  adding --disable-renderer-backgrounding, 1 test per variant
  unique window per file
  run unit tests w/ concurrency=1
  overflow: hidden, remove new Promise, add debug logging
  chore(driver): move cy.within logic into it's own file (#20036)
  increase timeout
  add new bases with antialiasing and custom courier font
  ...
brian-mann pushed a commit that referenced this pull request Feb 5, 2022
* develop:
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)
tgriesser added a commit that referenced this pull request Feb 7, 2022
* develop:
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
tgriesser added a commit that referenced this pull request Feb 7, 2022
* 10.0-release:
  chore: make error more informative about migration to Cypress 10 (#20007)
  fix: remove shelljs in example build script, correct file renames
  fix: last step in the ct setup goes back to start  (#20030)
  fix: typescript default plugin file (#20046)
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)
  release 9.4.1 [skip ci]
  fix: trigger 9.4.1 build
  release 9.4.0 [skip ci]
brian-mann added a commit that referenced this pull request Feb 11, 2022
* chore: rename errors.js -> errors.ts

* refactor: type safety on errors

* refactor: add err_template for consistent error formatting

* fix a few system tests

* fix tests; update snapshots

* Fix types

* normalize snapshot - remove chalk ansi colors

* more unit test fixes

* more system test fixes

* circleci build

* backtick always in stdout, fix error formatting and failing snapshots

* refactor: create @packages/errors

* fix import

* fix import

* fixing build / tests

* remove extraneous file

* move warnIfExplicitCiBuildId

* fix build / tests

* Fix

* error, type fixes, documentation, standardize child process error serialization

* fix import

* build errors on install

* wrote specs generating visual images of all errors

* remove unused dep

* sanitize stack traces

* add image diffing

- if base images don't exist, create them
- if base images don't match and local, overwrite them, if in CI throw
- if base images are stale and local, delete them, if in CI throw

* remove Courier New + MesloLGS NF font

* type fixes, remove Bluebird, general cleanup

* TS Cleanup

* skip typecheck on tests for now

* yarn.lock

* fix @types/chai version

* fix yarn.lock

* Different version of mocha types so it isnt patched

* errors spec snapshot

* CI fix

* fixes

* store snapshot images in circle artifacts

* dont change artifact destination prefix

* use Courier Prime

* antialias the text

* decrease pixelmatch threshold, fail in CI only when changed pixels > 100

* increase timeout

* overflow: hidden, remove new Promise, add debug logging

Co-Authored-By: Tim Griesser <tgriesser@gmail.com>

* run unit tests w/ concurrency=1

* unique window per file

* disable app hardware acceleration + use in process gpu + single process

* do not do image diffing

- conditionally convert html to images
- store html snapshots
- do not store images in git

* store snapshot html

* Merge branch 'tgriesser/chore/refactor-errors' of https://github.com/cypress-io/cypress into tgriesser/chore/refactor-errors

* remove concurrency

* fix assertion

* fixing ci

* Link in readme

* pass the browsers to listItems

* fix: build @packages/errors in CI, defer import to prevent errors locally

* Merge branch 'develop' into tgriesser/chore/refactor-errors

* develop:
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)

* fix run-if-ci.sh

* remove dead code

* Mark the .html files as generated in gitattributes

* fix running single error case, slice out more of the brittle stack

* remove additional brittle stack line

* firefox web security error

* nest inside of describe

* reformat and redesign errors

* more error cleanup and standardization

* additional formatting of errors, code cleanup, refactoring

* update ansi colors to match terminal colors

* cleanup remaining loose ends, update several errors, compact excess formatters

* fix types

* additional formatting, remove TODO's, ensure no [object Object] in output

* add test for 412 server response on invalid schema

* update unknown dashboard error on creating run

* use fs.access instead of fs.stat for perf

* added PLUGINS_FILE_NOT_FOUND error

- separated out from PLUGINS_FILE_ERROR
- add system tests for both cases
- update snapshots
- remove stack trace from PLUGINS_FILE_NOT_FOUND fka PLUGINS_FILE_ERROR

* add plugins system test around plugins synchronously throwing on require

* remove forcing process.cwd() to be packages/server, update affected code

- this was a long needed hangover from very old code that was doing unnecessary things due to respawning electron from node and handling various entrypoints into booting cypress
- this also makes the root yarn dev and dev-debug work correctly because options.cwd is set correctly now

* perf: lazy load chalk

* remove excessive line since the file exists but is invalid

* fix types

* add system test when plugins function throws a synchronous error

* create new PLUGINS_INVALID_EVENT_ERROR, wire it up correctly for error template use

- properly pass error instance from child to ensure proper user stack frames
- move error display code into the right place

* only show a single stack trace, either originalError or internal cypressError

* push error html snapshots

* fix tests, types

* fix test

* fix failing tests

* fix tests

* fixes lots of broken tests

* more test fixes

* fixes more tests

* fix type checking

* wip: consistent handling of interpolated values

* feat: fixing up errors, added simple error comparison tool

* wrapping up error formatting

* Fixes for unit tests

* fix PLUGINS_VALIDATION_ERROR

* fix fs.readdir bug, show rows even if there's only markdown formatting [SKIP CI]

* when in base-list, show full width of errors

* Fix type errors

* added searching and filtering for files based on error name

* fix: system tests

* updated NO_SPECS_FOUND error to properly join searched folder + pattern

- join patterns off of process.cwd, not projectRoot
- highlight original specPattern in yellow, baseDir in blue
- add tests

* fixes failing tests

* fix test

* preserve original spec pattern, display relative to projectRoot for terminal banner

* make the nodeVersion path display in gray, not white

* fix tests, pass right variables

* fix chrome:canary snapshots

* update snapshots

* update snapshot

* strip newlines caused by "Still waiting to connect to {browser}..."

* don't remove the snapshotHtmlFolder in CI, add additional verification snapshots match to error keys symmetrically

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update gitignore

* fix snapshot

* update snapshot html

* update logic for parsing the resolve pattern matching, add tests

* update snapshots

* update snapshot

* update snapshot

* update snapshot

* fix failing test

* fix: error_message_spec

* fix snapshot

* run each variant through an it(...) so multiple failures are received

* add newlines to multiline formatters, add fmt.stringify, allow format overrides

* stringify invalid return values from plugins

* move config validation errors into packages/errors, properly highlight and stringify values

* add component testing yarn commands

* fix the arrow not showing on details

* fix typescript error

* fixed lots of poorly written tests that weren't actually testing anything. created settings validation error when given a string validation result.

* fixes tests

* fixes tests, adds new error template for validating within an array list (for browser validation)

* remove dupe line

* fix copy for consistency, update snapshots

* remove redundant errors, standardize formatting and phrasing

* more formatting

* remove excess snapshots

* prune out excessive error snapshot html files when not in CI

* add missing tests, add case for when config validation fails without a fileType

* fixes test

* update snapshot

* update snapshot

* update snapshot

* sort uniqErrors + errorKeys prior to assertion - assert one by one

* add system test for binding to an event with the wrong handler

* fixes tests

* set more descriptive errors when setting invalid plugin events, or during plugin event validation

* remove duplicate PLUGINS_EVENT_ERROR, collapse into existing error

* use the same multiline formatting as @packages/errors

* standardize verbiage and highlighting for consistency

* fix incorrect error path

* fixes tests, standardized and condensed more language

* Update packages/errors/src/errors.ts

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update guides/error-handling.md

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update guides/error-handling.md

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* added some final todo's

* fix types

Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
Co-authored-by: Tim Griesser <tgriesser@gmail.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants