-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-changed-files fails with missing merge base #11271
Comments
Updated the description after debugging a bit more. The issue seems to be due to a missing merge base rather than being in a detached HEAD state. |
It sorta makes sense to me to fail in this case as the commit is missing. What should the behaviour be? We should not just ignore the flag as we wanna pick up typos (I think). Should we just document you need some other fetch depth for the flag to work? I guess we could print a warning if we cannot resolve the base and just run all tests |
Hey @SimenB, thanks for reviewing this issue so quickly. I think even if the merge base is missing, if we have another branch to compare against, we can still run a diff on it. I was experimenting with running something like Even if it would be preferred to not modify the current |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
💥 Regression Report
When an environment does not have the full commit history, running jest with the
--changedSince
option fails with an error.A repository may find itself in this state when checking out a single commit rather than cloning the whole repo and history.
The regression was introduced in #10155.
Last working version
Worked up to version: 26.1.0
Stopped working in version: 26.2.0
To Reproduce
Steps to reproduce the behavior:
jest --changedSince=master
Expected behavior
jest-changed-files should detect changed files without erroring with a non-zero exit code.
Link to repl or repo (highly encouraged)
https://github.com/jdanil/jest-changed-files-repro
Logs from CI for any pull request.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: