-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New
alr printenv --last-build
(#1444)
* New `alr printenv --last-build` This may be useful when no direct editing of manifests is convenient, as otherwise `printenv` will always use the manifest's configuration. * make new behavior the default with fallback * CI fixes
- Loading branch information
Showing
13 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Test that `alr printenv --last-build` works as expected. | ||
""" | ||
|
||
from drivers import builds | ||
from drivers.alr import alr_with, init_local_crate, run_alr | ||
from drivers.asserts import assert_match | ||
|
||
builds.enable_shared() | ||
|
||
init_local_crate() | ||
alr_with("libhello") | ||
run_alr("build") | ||
|
||
# After a default build, we obtain the hash of the build in release mode | ||
hash_release = builds.find_hash("libhello") | ||
|
||
builds.clear_builds_dir() | ||
|
||
# Now obtain the hash of the build in development mode | ||
run_alr("build", "--profiles=*=development") | ||
hash_devel = builds.find_hash("libhello") | ||
|
||
assert hash_release != hash_devel, "Hashes should be different" | ||
|
||
# Check default printenv behavior, which is to repeat last build settings | ||
p = run_alr("printenv") | ||
assert_match(f".*LIBHELLO_ALIRE_PREFIX=[^\n]*{hash_devel}", p.out) | ||
|
||
# Check printenv --last-build behaviors | ||
|
||
p = run_alr("printenv", "--last-build") | ||
assert_match(f".*LIBHELLO_ALIRE_PREFIX=[^\n]*{hash_devel}", p.out) | ||
|
||
p = run_alr("printenv", "--last-build=true") | ||
assert_match(f".*LIBHELLO_ALIRE_PREFIX=[^\n]*{hash_devel}", p.out) | ||
|
||
p = run_alr("printenv", "--last-build=false") | ||
assert_match(f".*LIBHELLO_ALIRE_PREFIX=[^\n]*{hash_release}", p.out) | ||
|
||
print("SUCCESS") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
driver: python-script | ||
indexes: | ||
build_hash_index: {} |
This file contains 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