-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests for fetch_releases
pulling test images from quay.io
#11
Merged
openshift-merge-robot
merged 4 commits into
openshift:master
from
steveej-forks:test-fetch-releases-against-quay
Jan 7, 2019
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b5c4578
graph-builder: test fetch_releases with quay.io
steveej 7bc45e8
dist/pr_check: make docker optional; add custom cargo arguments
steveej 59faf0d
dist/pr_check: enable network tests in graph-builder
steveej 31d0856
README: add informatinon on tests and CI/CD
steveej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep this private. Nobody should be looking at this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is that we can't create an instance of it manually if it's private:
What would be the simplest way to solve this? E.g., should we make a
new()
method for constructing one?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just be able to implement the Default trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried your suggestion but it seems to be effectively the same as without the
Default
implementation. I'm getting the error:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I was afraid of. Oh well, it's not the end of the world to make that public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented my previously mentioned idea with the
new(..)
method. PTAL at 4010c8c#diff-f0669f981e48dab0c10160890afd503bR34. I don't think it's actually much worse than thedefault()
method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this OOB and concluded that consumers of these objects need to be able to read this field too, so making this public is a requirement anyway.