-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_input/ | ||
test_bundle.tar |
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 @@ | ||
bobMinimumVersion: "0.25.1.dev43" |
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,19 @@ | ||
root: True | ||
|
||
depends: | ||
- input-a | ||
- input-b | ||
- input-c | ||
- input-d | ||
- name: input-indeterministic | ||
if: ${TEST_INDETERMINISTIC_INPUT:-False} | ||
|
||
checkoutDeterministic: True | ||
checkoutScript: | | ||
echo "it works" >> bundled_script.txt | ||
buildScript: | | ||
cat $1/bundled_script.txt | ||
packageScript: | | ||
/bin/true |
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,34 @@ | ||
multiPackage: | ||
"a": | ||
checkoutSCM: | ||
scm: url | ||
url: "${INPUT_BASE}/a/test.tgz" | ||
digestSHA1: "${INPUT_A_DIGEST}" | ||
stripComponents: 1 | ||
"b": | ||
checkoutSCM: | ||
scm: url | ||
url: "${INPUT_BASE}/b/test.tgz" | ||
digestSHA1: "${INPUT_B_DIGEST}" | ||
stripComponents: 1 | ||
"c": | ||
checkoutSCM: | ||
scm: url | ||
url: "${INPUT_BASE}/c/test.tgz" | ||
digestSHA1: "${INPUT_C_DIGEST}" | ||
stripComponents: 1 | ||
"d": | ||
checkoutSCM: | ||
scm: url | ||
url: "${INPUT_BASE}/d/test.tgz" | ||
digestSHA1: "${INPUT_D_DIGEST}" | ||
stripComponents: 1 | ||
"indeterministic": | ||
checkoutScript: | | ||
echo foo | ||
buildScript: | | ||
/bin/true | ||
packageScript: | | ||
/bin/true |
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,72 @@ | ||
#!/bin/bash -e | ||
. ../../test-lib.sh 2>/dev/null || { echo "Must run in script directory!" ; exit 1 ; } | ||
|
||
cleanup | ||
rm -f test_bundle.tar | ||
|
||
trap 'rm -f test_bundle.tar' EXIT | ||
|
||
# generate some input | ||
if [[ ! -d _input ]]; then | ||
mkdir -p _input | ||
pushd _input | ||
mkdir -p a b c d | ||
|
||
for x in a b c d; do | ||
dd if=/dev/urandom of=$x/test.dat bs=1M count=10 | ||
tar czf $x/test.tgz $x/test.dat | ||
done | ||
|
||
popd # _input | ||
fi | ||
|
||
run_bob dev bundle -j 5 \ | ||
-DINPUT_BASE="$PWD/_input" \ | ||
-DINPUT_A_DIGEST="$(sha1sum _input/a/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_B_DIGEST="$(sha1sum _input/b/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_C_DIGEST="$(sha1sum _input/c/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_D_DIGEST="$(sha1sum _input/d/test.tgz | cut -d ' ' -f 1)" | ||
expect_exist dev/src/input/1/download | ||
|
||
run_bob dev bundle -j 5 \ | ||
-DINPUT_BASE="$PWD/_input" \ | ||
-DINPUT_A_DIGEST="$(sha1sum _input/a/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_B_DIGEST="$(sha1sum _input/b/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_C_DIGEST="$(sha1sum _input/c/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_D_DIGEST="$(sha1sum _input/d/test.tgz | cut -d ' ' -f 1)" \ | ||
--bundle test_bundle.tar | ||
expect_exist test_bundle.tar | ||
|
||
cleanup | ||
rm -f test_bundle.tar | ||
|
||
run_bob dev bundle -j 5 \ | ||
-DINPUT_BASE="$PWD/_input" \ | ||
-DINPUT_A_DIGEST="$(sha1sum _input/a/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_B_DIGEST="$(sha1sum _input/b/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_C_DIGEST="$(sha1sum _input/c/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_D_DIGEST="$(sha1sum _input/d/test.tgz | cut -d ' ' -f 1)" \ | ||
--bundle test_bundle.tar | ||
expect_exist test_bundle.tar | ||
|
||
cleanup | ||
run_bob dev bundle -j 5 \ | ||
-DINPUT_BASE="/notexisting" \ | ||
-DINPUT_A_DIGEST="$(sha1sum _input/a/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_B_DIGEST="$(sha1sum _input/b/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_C_DIGEST="$(sha1sum _input/c/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_D_DIGEST="$(sha1sum _input/d/test.tgz | cut -d ' ' -f 1)" \ | ||
--bundle test_bundle.tar --unbundle | ||
expect_not_exist dev/src/input/1/download/ | ||
|
||
cleanup | ||
rm -f test_bundle.tar | ||
|
||
expect_fail run_bob dev bundle -j 5 \ | ||
-DINPUT_BASE="$PWD/_input" \ | ||
-DINPUT_A_DIGEST="$(sha1sum _input/a/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_B_DIGEST="$(sha1sum _input/b/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_C_DIGEST="$(sha1sum _input/c/test.tgz | cut -d ' ' -f 1)" \ | ||
-DINPUT_D_DIGEST="$(sha1sum _input/d/test.tgz | cut -d ' ' -f 1)" \ | ||
-DTEST_INDETERMINISTIC_INPUT=True \ | ||
--bundle test_bundle.tar |