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

Refix integration tests #2862

Closed
wants to merge 5 commits into from
Closed

Conversation

kraenhansen
Copy link
Member

What, How & Why?

History

We've recently experienced a regression with package-lock integrity checks failed for our integration tests environments.
This was fixed with #2842 by removing the environments package locks.
I was personally opposed to this fix since it in my opinion introduces another substantial downside, that we won't be able to reproduce failures between our local setup and CI, since the packages will essentially install the latest compatible version of any package allowed by the semantic constraints in the environments package.json files. In particular, we would always be running our tests against latest React Native (if we didn't pin the version in the package.json file).

The root cause of the issue is a change we merged back in november of last year, which adds the "realm" and "realm-integration-tests" packages as path dependencies to packed archives. This introduced an issue where the integrity of the archive produced on CI wouldn't match the hash in the package-lock.json.
The workaround was a "preinstall" scripts that would install the archive and update the hashes in the lock before the actual install (or ci) ran.
This worked until I accidentally changed the preinstall script to run with --no-save because - well I forgot why I made it this way in the first place ...

Why would the archives be dependencies in the first place?

Because a lot of tools, including electron-builder, CocoaPods pod install and the React Native Android Gradle files all depend on native modules being listed in dependencies for them to correctly bundle or install the packages.

This PR

This replaces #2842 as an attempt to fix the original issue as well as addressing the concern around removing package-locks from the environment packages.
The idea is to introduce a shared script (peer-deps-as-deps.js) which will temporarily modify an environments package.json by moving its peer dependencies into its dependencies.
This script can be invoked with another command as a runtime argument that it will run and restore the package.json after it exits (or gets interrupted).

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

@kraenhansen kraenhansen self-assigned this May 6, 2020
@kraenhansen
Copy link
Member Author

This got replaced by #3690

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant