@@ -12,22 +12,24 @@ TARGET_NAME=${TARGET_NAME:="unit"}
12
12
# TODO(tflannag): Do we need to trap anything here? Maybe remove staging/*/vendor during SIGINT?
13
13
pushd " ${ROOT_DIR} /staging/${WHAT} "
14
14
15
- if [[ ! -d ${ROOT_DIR} /staging/${WHAT} /vendor ]]; then
16
- # Note(tflannag): We don't introduce nested vendor packages into source control,
17
- # and this script will fail when attempting to populate a vendor directory using
18
- # `go test ...`, so vendor first, then run unit tests.
19
- #
20
- # This is likely a poor strategy to maintain going forward as there's a chance we're testing
21
- # against dependencies that don't match what we build with but that should be fine for now.
22
- # We'll likely want to migrate towards having a dedicated test/e2e package that
23
- # runs downstream-specific OLM and registry tests instead of relying on the test packages that
24
- # we pull in from the staging equivalent. In the case of OSBS, where we can't `go get ...` packages from
25
- # external sources, so this should be fine in the testing scenario, but we need the vendor/ when building
26
- # binaries due to the restricted environment. Fortunately, it looks we're able to build from the root directory,
27
- # so it's sufficient for now.
28
- echo " Populating nested staging vendor directory"
29
- go mod vendor && go mod tidy
30
- fi
15
+ for remote in " ${UPSTREAM_REMOTES[@]} " ; do
16
+ if [[ ! -d ${ROOT_DIR} /staging/${remote} /vendor ]]; then
17
+ # Note(tflannag): We don't introduce nested vendor packages into source control,
18
+ # and this script will fail when attempting to populate a vendor directory using
19
+ # `go test ...`, so vendor first, then run unit tests.
20
+ #
21
+ # This is likely a poor strategy to maintain going forward as there's a chance we're testing
22
+ # against dependencies that don't match what we build with but that should be fine for now.
23
+ # We'll likely want to migrate towards having a dedicated test/e2e package that
24
+ # runs downstream-specific OLM and registry tests instead of relying on the test packages that
25
+ # we pull in from the staging equivalent. In the case of OSBS, where we can't `go get ...` packages from
26
+ # external sources, so this should be fine in the testing scenario, but we need the vendor/ when building
27
+ # binaries due to the restricted environment. Fortunately, it looks we're able to build from the root directory,
28
+ # so it's sufficient for now.
29
+ echo " Populating nested staging vendor directory"
30
+ go mod vendor && go mod tidy
31
+ fi
32
+ done
31
33
32
34
make ${TARGET_NAME}
33
35
popd
0 commit comments