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

Fix diff command when running in nested directory #26

Merged
merged 3 commits into from Nov 30, 2022

Conversation

vkammerer
Copy link
Contributor

@vkammerer vkammerer commented Nov 7, 2022

I noticed that my tests were:

  • failing when running in parallel (with melos)
  • but passing when running independently or sequentially.

This is due to the diffing command being applied to the whole directory, and not just to the current workingDir. So if I have package a and package b, a diff in package b (due to a file being regenerated) will cause package a to notice a diff and fail the test, even if its own directory doesn't have any diff.

This PR makes sure that the diff is computed only for the current working directory, which enables tests using this package to run in parallel inside monorepos.

@kevmoo
Copy link
Owner

kevmoo commented Nov 9, 2022

That's what I have https://pub.dev/documentation/build_verify/latest/build_verify/expectBuildClean.html for

...although this might be better.

Would you update the tests to validate this behavior?

@vkammerer
Copy link
Contributor Author

@kevmoo I reworked my PR by:

  • first updating the tests with 24b5b5d. If you checkout the branch at this commit, the test when package b has modifications, package a test should pass and package b test should fail will fail
  • then added my original fix on top, which makes the test pass

@vkammerer
Copy link
Contributor Author

Hi @kevmoo , is there anything else I should do to move this PR forward?

@kevmoo
Copy link
Owner

kevmoo commented Nov 30, 2022

@vkammerer – looking now! Thanks for your patience!

@kevmoo kevmoo merged commit 05aae54 into kevmoo:master Nov 30, 2022
@kevmoo
Copy link
Owner

kevmoo commented Nov 30, 2022

Thanks again, @vkammerer – published!

@vincent-hoodoo
Copy link

@kevmoo yay! My CI tests duration will be happy to hear the news 😃

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.

None yet

3 participants