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

multi runner tests and bugfixes #4023

Merged
merged 1 commit into from
Jul 13, 2017
Merged

Conversation

aaronabramov
Copy link
Contributor

right now there's a bug in multi runner.
it can run jest --projects p1 p2
but can't run jest --config c.json with c.json having {projects: ['p1', 'p2']}

I added a test for MPR and fixed the config bug

// It only used to read initial config. If the initial config contains
// `project` property, we don't want to read `--config` value and rather
// read individual configs for every project.
dontUseArgvConfig?: boolean,
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 really want to rewrite this file and the part of jest-cli that resolves/reads config. This function should not be used for every config resolution (default config resolution, --config file.js, `--config '{"json": true}', and MPR configs) because they have different logic and using the same flow for everything will cause a lot of bugs.
this little hack should work for now though

Copy link
Member

Choose a reason for hiding this comment

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

Ok, for now, can you call this variable something else? Having dont isn't great, given that you are testing for the opposite anyway.

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 can't really come up with a more descriptive name. renamed it to skipArgvConfigOption. I hope that works!

const file1 = require('file1');
test('file1', () => {});
`,
'project1/file1.js': fileContentWithProvidesModule('file1'),
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 used haste modules to make sure multiple roots with the same modules don't conflict with each other using MPR (happened in fb/www)

root = path.resolve(process.cwd(), rawOptions);
// A string passed to `--config`, which is either a direct path to the config
// or a path to directory containing `package.json` or `jest.conf.js`
if (!dontUseArgvConfig && typeof argv.config == 'string') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for MPR runs with --config specified this would always be true and --config value would've been taken for each project

@codecov-io
Copy link

codecov-io commented Jul 13, 2017

Codecov Report

Merging #4023 into master will increase coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4023      +/-   ##
==========================================
+ Coverage   60.28%   60.31%   +0.02%     
==========================================
  Files         196      196              
  Lines        6764     6761       -3     
  Branches        6        6              
==========================================
  Hits         4078     4078              
+ Misses       2683     2680       -3     
  Partials        3        3
Impacted Files Coverage Δ
packages/jest-config/src/index.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d00d13...3ab9f2a. Read the comment docs.

@cpojer
Copy link
Member

cpojer commented Jul 13, 2017

Love it, please rename the variable. <3

@aaronabramov aaronabramov merged commit 03c6814 into jestjs:master Jul 13, 2017
@aaronabramov aaronabramov deleted the mpr_tests branch July 13, 2017 22:43
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

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

Successfully merging this pull request may close these issues.

4 participants