Skip to content

Unit tests in venia can run against stale peregrine code #54

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

Closed
DrewML opened this issue Jun 18, 2018 · 0 comments
Closed

Unit tests in venia can run against stale peregrine code #54

DrewML opened this issue Jun 18, 2018 · 0 comments
Assignees
Labels
bug Something isn't working pkg:venia-concept tooling Related to the developer tooling, including buildpack, webpack plugins, and debug UIs.

Comments

@DrewML
Copy link
Contributor

DrewML commented Jun 18, 2018

This issue is for the following packages:

[X] venia-concept
[ ] pwa-buildpack
[ ] peregrine
[ ] pwa-module

This issue is a:

[X] Bug
[ ] Feature suggestion
[ ] Other (Please Specify)

Environment

Question Answer
Magento version
Operating System + version
node.js version (node -v)
npm version (npm -v)

Description

Steps to Replicate

  1. Run npm install in the root of the repository to bootstrap
  2. Run rm -rf packages/peregrine/dist in the root of the repository
  3. Run npm test in the root of the repository

Tests in venia-concept should fail with Cannot find module '@magento/peregrine' from 'foobar.js'. This means tests in venia-concept that consume @magento/peregrine are pulling in the last built version of the lib locally, which may not be up-to-date with the src files in @magento/peregrine.

Expected result:

Cross-package unit/integration tests always consume from src, not dist. The dist artifact should only ever be used for publishing to npm, and nothing else.

Cross-package unit/integration tests always consume from src, not dist.

Possible solutions:

Use Jest's configuration to re-write paths for libs in this monorepo, to ensure that:

  1. Jest handles transpiling the src of the libs in this repo with Babel
  2. Jest pulls files from src, rather than the dist it finds in the package's main entry in package.json.
@DrewML DrewML added bug Something isn't working tooling Related to the developer tooling, including buildpack, webpack plugins, and debug UIs. pkg:peregrine pkg:venia-concept labels Jun 18, 2018
@DrewML DrewML self-assigned this Jun 18, 2018
@DrewML DrewML added the has PR label Jun 18, 2018
@DrewML DrewML changed the title Unit tests can run against stale code Unit tests in venia can run against stale peregrine code Jun 18, 2018
DrewML added a commit that referenced this issue Jun 19, 2018
…acts (#55)

Closes #54.

<!-- (REQUIRED) What is the nature of this PR? -->

## This PR is a:

[ ] New feature
[ ] Enhancement/Optimization
[ ] Refactor
[X] Bugfix
[ ] Test for existing code
[ ] Documentation

<!-- (REQUIRED) What does this PR change? -->

## Summary

See #54 .
<!-- (OPTIONAL) What other information can you provide about this PR? -->

## Additional information

<!--
Thank you for your contribution!

Before submitting this pull request, please make sure you have read our Contribution Guidelines and your PR meets our contribution standards:
https://github.com/magento-research/venia-pwa-concept/blob/master/.github/CONTRIBUTION.md

Please fill out as much information as you can about your PR to help speed up the review process.
If your PR addresses an existing GitHub Issue, please refer to it in the title or Additional Information section to make the connection.

We may ask you for changes in your PR in order to meet the standards set in our Contribution Guidelines. PR's that do not comply with our guidelines may be closed at the maintainers' discretion.

Feel free to remove this section before creating this PR.
-->
DrewML added a commit that referenced this issue Jun 21, 2018
…ata fetching (#52)

~~**Note** This branch surfaced an issue with the unit/integration test setup in the monorepo. Freezing work on this branch until I've completed #54

Closes #20 

<!-- (REQUIRED) What is the nature of this PR? -->

## This PR is a:

[ ] New feature
[X] Enhancement/Optimization
[ ] Refactor
[ ] Bugfix
[ ] Test for existing code
[ ] Documentation

<!-- (REQUIRED) What does this PR change? -->

## Summary

Same code from magento-research/venia-pwa-concept#89, now moved over and tests fixed.
<!-- (OPTIONAL) What other information can you provide about this PR? -->

## Additional information

<!--
Thank you for your contribution!

Before submitting this pull request, please make sure you have read our Contribution Guidelines and your PR meets our contribution standards:
https://github.com/magento-research/venia-pwa-concept/blob/master/.github/CONTRIBUTION.md

Please fill out as much information as you can about your PR to help speed up the review process.
If your PR addresses an existing GitHub Issue, please refer to it in the title or Additional Information section to make the connection.

We may ask you for changes in your PR in order to meet the standards set in our Contribution Guidelines. PR's that do not comply with our guidelines may be closed at the maintainers' discretion.

Feel free to remove this section before creating this PR.
-->
fnhipster pushed a commit to PMET-public/pwa-studio that referenced this issue Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:venia-concept tooling Related to the developer tooling, including buildpack, webpack plugins, and debug UIs.
Projects
None yet
Development

No branches or pull requests

1 participant