Skip to content

Commit 0c051e2

Browse files
committed
Make tests work
1 parent 96108a0 commit 0c051e2

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313

1414
# Ignore the built binary
1515
cert-manager-webhook-ovh
16+
_out

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ OUT := $(shell pwd)/_out
66
$(shell mkdir -p "$(OUT)")
77

88
verify:
9+
sh ./scripts/fetch-test-binaries.sh
910
go test -v .
1011

1112
build:

main_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func TestRunsSuite(t *testing.T) {
1717
// ChallengeRequest passed as part of the test cases.
1818

1919
fixture := dns.NewFixture(&customDNSProviderSolver{},
20+
dns.SetBinariesPath("_out/kubebuilder/bin"),
2021
dns.SetResolvedZone(zone),
2122
dns.SetAllowAmbientCredentials(false),
2223
dns.SetManifestPath("testdata/ovh"),

scripts/fetch-test-binaries.sh

+24
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
11
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
k8s_version=1.14.1
6+
arch=amd64
7+
8+
if [[ "$OSTYPE" == "linux-gnu" ]]; then
9+
os="linux"
10+
elif [[ "$OSTYPE" == "darwin"* ]]; then
11+
os="darwin"
12+
else
13+
echo "OS '$OSTYPE' not supported." >&2
14+
exit 1
15+
fi
16+
17+
root=$(cd "`dirname $0`"/..; pwd)
18+
output_dir="$root"/_out
19+
archive_name="kubebuilder-tools-$k8s_version-$os-$arch.tar.gz"
20+
archive_file="$output_dir/$archive_name"
21+
archive_url="https://storage.googleapis.com/kubebuilder-tools/$archive_name"
22+
23+
mkdir -p "$output_dir"
24+
curl -sL "$archive_url" -o "$archive_file"
25+
tar -zxf "$archive_file" -C "$output_dir/"

0 commit comments

Comments
 (0)