-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Enable Acceptance Tests (#103)
Enable acceptance tests and fix existing tests. 1) Enable running acceptance tests on `make test` command when the user places a kubeconfig file into the repository. This kubeconfig is necessary since the acceptance tests are checked against a real Harvester cluster. If the kubeconfig file is missing, only unit tests are run, which doesn't require a Harvester cluster. 2) Fix existing tests. Some existing acceptance tests where using invalid terraform resources. These are fixed 3) Fix volume and network resource providers. Running acceptance tests revealed bugs in the volume and network resource providers. Both were using an incorrect method to determine if a resource had been deleted in Harvester. The bug was that the resource providers were waiting for a deletion event, despite the fact that the respective controllers don't emit such an event. The fix is to observe the resource through a periodic read. 4) Fix propagating the cluster network name of a network resource into the terraform state. The terraform state needs to keep track of this property to determine if the resource definition has changed. Otherwise the resource will always count as modified, which is in some cases wrong. This bug was also revealed by the acceptance tests. Signed-off-by: Moritz Röhrich <[email protected]>
- Loading branch information
1 parent
45fde4b
commit 55ee9e6
Showing
9 changed files
with
122 additions
and
38 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ ARG DAPPER_HOST_ARCH | |
ENV ARCH $DAPPER_HOST_ARCH | ||
|
||
RUN zypper -n rm container-suseconnect && \ | ||
zypper -n install curl docker gzip tar wget awk zip | ||
zypper -n install curl docker gzip tar wget awk zip unzip | ||
|
||
# install goimports | ||
RUN GO111MODULE=on go install golang.org/x/tools/cmd/[email protected] | ||
|
@@ -13,16 +13,23 @@ RUN GO111MODULE=on go install golang.org/x/tools/cmd/[email protected] | |
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1 | ||
|
||
# The docker version in dapper is too old to have buildx. Install it manually. | ||
RUN wget https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \ | ||
RUN wget --quiet https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \ | ||
wget --quiet https://releases.hashicorp.com/terraform/0.13.4/terraform_0.13.4_linux_${ARCH}.zip && \ | ||
chmod +x buildx-v0.13.1.linux-${ARCH} && \ | ||
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx | ||
unzip terraform_0.13.4_linux_${ARCH}.zip && \ | ||
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx && \ | ||
mv terraform /usr/local/bin/terraform | ||
|
||
ENV DAPPER_ENV REPO TAG DRONE_TAG | ||
ENV DAPPER_SOURCE /go/src/github.com/harvester/terraform-provider-harvester | ||
ENV DAPPER_OUTPUT ./bin ./dist | ||
ENV DAPPER_DOCKER_SOCKET true | ||
ENV HOME ${DAPPER_SOURCE} | ||
|
||
COPY go.mod ${DAPPER_SOURCE}/go.mod | ||
COPY go.sum ${DAPPER_SOURCE}/go.sum | ||
WORKDIR ${DAPPER_SOURCE} | ||
RUN go mod download | ||
|
||
ENTRYPOINT ["./scripts/entry"] | ||
CMD ["ci"] |
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 |
---|---|---|
|
@@ -24,6 +24,8 @@ const ( | |
resource %s "%s" { | ||
%s = "%s" | ||
%s = "%s" | ||
parameters = { | ||
} | ||
} | ||
` | ||
) | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ set -e | |
|
||
cd $(dirname $0) | ||
|
||
./validate | ||
./build | ||
./test | ||
./validate | ||
./package |
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 |
---|---|---|
|
@@ -3,7 +3,4 @@ set -e | |
|
||
cd $(dirname $0) | ||
|
||
./build | ||
./test | ||
./validate | ||
./package | ||
./ci |
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