-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from steveeJ-forks/test-fetch-releases-against…
…-quay add tests for `fetch_releases` pulling test images from quay.io
- Loading branch information
Showing
25 changed files
with
344 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -ex | ||
|
||
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
source "${ABSOLUTE_PATH}/commons.sh" | ||
declare -A cargo_test_flags | ||
cargo_test_flags["cincinnati"]="" | ||
cargo_test_flags["graph-builder"]="--features test-net" | ||
cargo_test_flags["policy-engine"]="" | ||
|
||
ensure_build_container | ||
declare -A executors | ||
executors["cargo"]="execute_native" | ||
executors["docker"]="execute_docker" | ||
|
||
function cleanup() { | ||
set +e | ||
docker_cargo_stop_all | ||
if [[ ! -n "$KEEP_CARGO_OUTPUT" ]]; then | ||
docker_cargo clean | ||
fi | ||
function run_tests() { | ||
for directory in ${!cargo_test_flags[*]}; do | ||
(${1} /usr/bin/env bash -c "\ | ||
cd ${directory} && \ | ||
export CARGO_TARGET_DIR="../target" && \ | ||
cargo test --release ${cargo_test_flags[${directory}]} && \ | ||
: | ||
") | ||
done | ||
} | ||
trap cleanup EXIT | ||
|
||
docker_cargo test | ||
function execute_native() { | ||
run_tests | ||
} | ||
|
||
function execute_docker() { | ||
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
source "${ABSOLUTE_PATH}/commons.sh" | ||
|
||
ensure_build_container | ||
|
||
function cleanup() { | ||
set +e | ||
docker_cargo_stop_all | ||
if [[ ! -n "$KEEP_CARGO_OUTPUT" ]]; then | ||
docker_cargo cargo clean --release | ||
fi | ||
} | ||
trap cleanup EXIT | ||
|
||
run_tests "docker_cargo" | ||
} | ||
|
||
for executor in ${!executors[@]}; do | ||
if type -f $executor; then | ||
${executors[${executor}]} | ||
exit 0 | ||
fi | ||
done | ||
|
||
echo error: could not find any of "${executors[@]}" in PATH | ||
exit 1 |
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,27 @@ | ||
extern crate cincinnati; | ||
extern crate dkregistry; | ||
extern crate env_logger; | ||
extern crate flate2; | ||
extern crate futures; | ||
extern crate itertools; | ||
extern crate reqwest; | ||
extern crate semver; | ||
extern crate serde; | ||
#[macro_use] | ||
extern crate serde_derive; | ||
extern crate actix_web; | ||
extern crate serde_json; | ||
extern crate tar; | ||
extern crate tokio; | ||
extern crate tokio_core; | ||
#[macro_use] | ||
extern crate failure; | ||
#[macro_use] | ||
extern crate log; | ||
#[macro_use] | ||
extern crate structopt; | ||
|
||
pub mod config; | ||
pub mod graph; | ||
pub mod registry; | ||
pub mod release; |
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
5 changes: 5 additions & 0 deletions
5
graph-builder/tests/images/test-emptyfirsttag-public-manual-0.0.0/Dockerfile
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 @@ | ||
FROM scratch as zero | ||
COPY EMPTY . | ||
|
||
FROM zero as one | ||
COPY EMPTY . |
1 change: 1 addition & 0 deletions
1
graph-builder/tests/images/test-emptyfirsttag-public-manual-0.0.0/EMPTY
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 @@ | ||
EMPTY |
1 change: 1 addition & 0 deletions
1
graph-builder/tests/images/test-emptyfirsttag-public-manual-0.0.1
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 @@ | ||
test-private-manual-0.0.0 |
1 change: 1 addition & 0 deletions
1
graph-builder/tests/images/test-emptyfirsttag-public-manual-0.0.2
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 @@ | ||
test-private-manual-0.0.1 |
11 changes: 11 additions & 0 deletions
11
graph-builder/tests/images/test-nojson-public-manual-0.0.0/Dockerfile
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,11 @@ | ||
FROM scratch as zero | ||
LABEL layer="0" | ||
|
||
FROM zero as one | ||
LABEL layer="1" | ||
|
||
FROM one as two | ||
LABEL layer="2" | ||
|
||
FROM two as three | ||
LABEL layer="3" |
5 changes: 5 additions & 0 deletions
5
graph-builder/tests/images/test-private-manual-0.0.0/Dockerfile
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 @@ | ||
FROM scratch as zero | ||
COPY release-metadata_0.json release-manifests/release-metadata | ||
|
||
FROM zero as one | ||
COPY release-metadata_1.json release-manifests/release-metadata |
7 changes: 7 additions & 0 deletions
7
graph-builder/tests/images/test-private-manual-0.0.0/release-metadata_0.json
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,7 @@ | ||
{ | ||
"kind": "cincinnati-metadata-v0", | ||
"version": "0.0.0", | ||
"metadata": { | ||
"kind": "ooyaeh4DiSohngoh6oiW7Eecughie3ue5bes4ooHoSei6iePhohwo3no6Izeejo3wei0iph9oJee8aimuo6Ohm2Chai3yothae8oethac7Eichae8choh3ael1aidath aech3ohph7ieSheeghal2ze3ido3leeKavau4eelohgeecuch4ai0Eivoo5eiwuoDoh8ohbieZai1Dahx4aaXaikageighiPhuemi8oci0wei1FoWoh6hietho9aiyun aenahtho0Sie8aiSh1Piemeix3eic9oemezohdai0ooBohthoos3eepiginashoyiet6hoosao8CheisohW5reel6Ae4Ohphaer6En9Eem8puvie9rahquaixo8Eijie OhLai9hooMohbeiyie7chae6oe5aiweRooshae8shieshohz3shaiT6paicae9eePeu4oVaehauPeiB7nohyei1riuyiejii6Au0Aebohgi9geig8ieveeghehus2gae Iep8shoewi0ahSheiMaew0echuyaefeimeeCoowoTh6zaeGh0loo7UPhoh5iGh9quieB2sha0ci8AhmapuYaequin8ieMumaedaeGhahG9eiKeir0ju5Shohqu9Iech2 CeeChauhei1uongaimood9athip5iekeiree4guoyaik1aivi7kahKae4xon4lai8eedeetaesh1xa9eo5Johg0ohc9desel5eiyaiph9pieshah5xoo7eeXahchie2t yaino1zool2eecheedubei2eichoh7beet7deiNg1ieraihooroh9Geequoo4thuegiesaina4Meis5chee5zengeg1looweeveide6eeNei4vohCinephuVaeghugoc chai3oupaJee8ohxo8ighah2bohPah9iip5saf6oohieb7OoK3iGhei5Oom1ohr6quohchangai9moo5Wie4raiwae6pooHeesahthi1ohrie0eJ4iSh6Aiy5fohgh8w chie5ahch9Urie3nab5quae6vae8wah7Xughova9kieh0looT4ri5Oes8einoovee7lee0ahheiN0oon9aNgeeTeesh9huloh0quohDah4bongeisha8heeshaido6di Ahh3gahngoh5odoocooth3jahgh5shee4Oojee0mierap0zichooLei5Aheilaiwo1bii2Lothou6so1riepheeteeHaemi5ieTei6OhJ0Pua7ahhusitieghooghiqu eel2sie1theRiub2oow3Eim5zoopheh1aeyooTeuBahreibae4aocai3aiD9iuz2ehe8ao4OodoshahzeeWei9aif6zie0oopee1quu7buru3eegaengah3quooNgahh vahrePu3fiNiibethahhiequieVaiTel8zei0EeyohquuJ3shaPohTa1sei5Aogo8Ohnet4saegha8ohn1Ohae5Koh1ShahsuuY8socaej1iz0aiboh5Pu5Zai1ja5oh ohthake0cohz8nii6ochuf0geeb8kahjiy4chee4Eip2aeghohfoo5Ru0De6ieShoceya6ogh3oodoh1tu1YeiZ8ahPaWi4yohsh9taipa7eiS1hoos8aup4waneo7eN peeng0seen0quoochee7aaNginei3ietaiquieJe9looziexaebaiph9Igheisho5Hei6ahThov2kaicohch9eingai5zaeb0Neijahsh6mooDaiworiequeeS9beiSu geiYoh3tie1tikahd8shaeque3Kah9gahyie0Doh4Veib5auFohquoo0eenguv4zo4uvahNahsow4bohl5LaiFieVeish7faef3eu4miBii8OoquaikaivaePheeshei eiy1xoa2uo3aege9uoNgei8losh6shi8gohyieleechit9lawaiR0ahngoh4eithoh6Oos5ooh7lahgah1quahpo2sioquui8cei4ruQu6LaebahpheeSoYai8Wiiri2 eechuPhooyohmah4eeshohP6idakeichiPhov6IeYaifabeij8aj8eng9umoophai1uYepezoh9aehua3Lai1hu4quu2vohjaleephoowai4woo6eishoo2chohphieV auy3CheehohSohthe9Quei0eigh7Heid2oochohjah2Deiph5aifeeph7ieshookoo4gaeb0con3queiph9teibeiloowae2voo6FaiheixaelaiyidaeHae6via4woo AhchooyiawaeYeequi8phofae1ooGei2Sae6tutah6ohQuai5epahloh3ookeech5EeMopheap1ohGh0ohzie5ieNg8looCh3oonooj0feochahzo1ua9iobenaesh5e ShiCeeboh8keezeisaip1oosaiNg4ChaKeej9nahFi5uhoDae4chooch2TiR0woo3ohng4aimiweth0io9nahQu0Icee2chi6Aelooqu9quuFaexaeShiesh1Hi6Aila" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
graph-builder/tests/images/test-private-manual-0.0.0/release-metadata_1.json
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 @@ | ||
{ | ||
"kind": "cincinnati-metadata-v0", | ||
"version": "0.0.0", | ||
"metadata": {} | ||
} |
2 changes: 2 additions & 0 deletions
2
graph-builder/tests/images/test-private-manual-0.0.1/Dockerfile
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 @@ | ||
FROM scratch | ||
COPY release-metadata release-manifests/release-metadata |
9 changes: 9 additions & 0 deletions
9
graph-builder/tests/images/test-private-manual-0.0.1/release-metadata
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,9 @@ | ||
{ | ||
"kind": "cincinnati-metadata-v0", | ||
"schema": 1, | ||
"version": "0.0.1", | ||
"previous": ["0.0.0"], | ||
"metadata": { | ||
"kind": "test" | ||
} | ||
} |
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 @@ | ||
test-private-manual-0.0.0 |
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 @@ | ||
test-private-manual-0.0.1 |
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 @@ | ||
#[cfg(feature = "test-net")] | ||
mod net; |
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 @@ | ||
mod quay_io; |
Oops, something went wrong.