-
-
Couldn't load subscription status.
- Fork 283
Backports release 1.8 #3090
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
Merged
Merged
Backports release 1.8 #3090
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cherry picked from commit 0b4686a)
(cherry picked from commit 487fdd1)
Co-authored-by: Eric Hanson <5846501+ericphanson@users.noreply.github.com> (cherry picked from commit 2b78a74)
Co-authored-by: Jameson Nash <vtjnash@gmail.com> (cherry picked from commit a23a4d9)
(cherry picked from commit 9f9abd9)
(cherry picked from commit 54d5c9e)
When calling `Pkg.test("Foo")`, some information from the calling
environment is incorporated into the tests of `Foo`; for example, if the
calling environment places restrictions on the package versions of
`Bar`, a dependency of `Foo`, those restrictions will be honored when
resolving the dependencies of the test environment for `Foo`.
Similarly, we should honor preferences set within the calling
environment. The easiest way to do this is to layer the test
environment onto the end of the current `LOAD_PATH` instead of wholesale
replacing it, as we were doing when copying preferences over for the
test environment.
With this change it is now viable to test alternate configurations of a
package without dev'ing it out and modifying it directly. If a package
`Foo` uses preference to alter its behavior, previously you would need
to `dev` it out and insert an override into its `LocalPreferneces.toml`
(or `test/LocalPreferences.toml`, if it had a separate test project) in
order for the preference to be read during test time. Now, one can
simply set the preference in an environment that has `Foo` added, then
run `Pkg.test("Foo")`, and as long as the package itself doesn't define
the preference within its own testing environment, it will pick up the
default from the environment.
We allow the package to override values coming in from the environment,
as there may be rather sensitive preferences that it is best to not
allow easy overriding from. For these cases, there is of course still
the `dev`-and-edit method available for tests.
(cherry picked from commit 5e5189b)
(cherry picked from commit dd7fbb2)
(cherry picked from commit 1da11e4)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backported PRs:
stdin.buffer#3041instantiatefor projects that are not packages #3075