-
-
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.
Fix deployment over pre-existing dependency dir (#1542)
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
In certain circumstances, deploying a dependency when its folder already exists | ||
(?) causes a failure. | ||
""" | ||
|
||
from glob import glob | ||
import os | ||
import shutil | ||
from drivers.alr import run_alr, crate_dirname | ||
|
||
run_alr("get", "hello") | ||
os.chdir(glob("hello_*")[0]) | ||
|
||
# Remove contens of the libhello dependency folder. The bug only happens if the | ||
# top-level folder is not removed, so we need to iterate over its contents. | ||
for dirpath, dirnames, filenames in \ | ||
os.walk(f"alire/cache/dependencies/{crate_dirname('libhello')}"): | ||
for filename in filenames: | ||
os.remove(os.path.join(dirpath, filename)) | ||
for dirname in dirnames: | ||
shutil.rmtree(os.path.join(dirpath, dirname)) | ||
|
||
# This should not fail after the bugfix | ||
run_alr("build") | ||
|
||
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,5 @@ | ||
driver: python-script | ||
build_mode: sandboxed | ||
indexes: | ||
basic_index: | ||
in_fixtures: true |