-
-
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.
Relocate cache with config builtin
cache.dir
- Loading branch information
Showing
8 changed files
with
88 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Check cache location overrides in increasing order of precedence. | ||
""" | ||
|
||
from drivers.alr import run_alr | ||
from drivers.asserts import assert_match | ||
from drivers.helpers import on_windows | ||
|
||
if on_windows(): | ||
drive = "C:" | ||
else: | ||
drive = "" | ||
|
||
# Default cache location (inside test config dir) | ||
assert_match(r".*cache folder:[^\n]*config__cache-relocation/alr-config/cache", | ||
run_alr("version").out.replace("\\", "/")) | ||
|
||
# Check toolchain location inside cache location | ||
assert_match(r".*toolchain folder:[^\n]*config__cache-relocation/alr-config/cache/toolchains", | ||
run_alr("version").out.replace("\\", "/")) | ||
|
||
# Override via config (takes precedence) | ||
run_alr("config", "--global", "--set", "cache.dir", f"{drive}/relocated-to-root") | ||
assert_match(r".*cache folder:[^\n]*/relocated-to-root", | ||
run_alr("version").out.replace("\\", "/")) | ||
|
||
# Check toolchain location inside cache location | ||
assert_match(r".*toolchain folder:[^\n]*/relocated-to-root/toolchains", | ||
run_alr("version").out.replace("\\", "/")) | ||
|
||
# Check toolchain override via config (takes precedence over cache override) | ||
run_alr("config", "--global", "--set", "toolchain.dir", f"{drive}/relocated-toolchains") | ||
assert_match(r".*toolchain folder:[^\n]*/relocated-toolchains", | ||
run_alr("version").out.replace("\\", "/")) | ||
|
||
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,4 @@ | ||
driver: python-script | ||
build_mode: both # one of shared, sandboxed, both (default) | ||
indexes: | ||
compiler_only_index: {} |