-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to execute tests against openshift CI. RHDP-417
Signed-off-by: Flavius Lacatusu <[email protected]>
- Loading branch information
Showing
6 changed files
with
333 additions
and
108 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# exit immediately when a command fails | ||
set -e | ||
# only exit with zero if all commands of the pipeline exit successfully | ||
set -o pipefail | ||
# error on unset variables | ||
set -u | ||
|
||
export WORKSPACE=$(dirname $(dirname $(readlink -f "$0"))); | ||
|
||
# catch and stop execution on any error | ||
trap "catchFinishedCode" EXIT SIGINT | ||
|
||
# Catch an error after existing from jenkins Workspace | ||
function catchFinishedCode() { | ||
EXIT_CODE=$? | ||
|
||
if [ "$EXIT_CODE" == "1" ]; then | ||
echo "[ERROR] Failed to validate e2e tests against Red Hat App Studio. Please check Openshift CI logs" | ||
fi | ||
|
||
exit $EXIT_CODE | ||
} | ||
|
||
function installRedHatAppStudio() { | ||
git clone https://github.com/redhat-appstudio/infra-deployments.git | ||
"${WORKSPACE}"/infra-deployments/hack/bootstrap-cluster.sh | ||
} | ||
|
||
function runE2ETests() { | ||
make build | ||
make run | ||
} | ||
|
||
installRedHatAppStudio | ||
runE2ETests |
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,18 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
coverage.* | ||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
bin/ | ||
.idea/ | ||
tmp/ |
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 |
---|---|---|
|
@@ -16,4 +16,3 @@ vendor/ | |
bin/ | ||
.idea/ | ||
tmp/ | ||
output/ |
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,12 +1,16 @@ | ||
BINARY_NAME := ./bin/e2e-appstudio | ||
E2E_BIN := ./bin/e2e-appstudio | ||
E2E_ARGS_EXEC ?= "" | ||
CONTAINER_TAG ?= next | ||
CONTAINER_IMAGE_NAME := quay.io/redhat-appstudio/e2e:$(CONTAINER_TAG) | ||
|
||
build: | ||
go mod vendor && CGO_ENABLED=0 go test -v -c -o $(BINARY_NAME) ./cmd/e2e_test.go | ||
go mod vendor && CGO_ENABLED=0 go test -v -c -o $(E2E_BIN) ./cmd/e2e_test.go | ||
|
||
build-container: | ||
podman build -t $(CONTAINER_IMAGE_NAME) --no-cache . | ||
|
||
push-container: | ||
podman push $(CONTAINER_IMAGE_NAME) | ||
|
||
run: | ||
$(E2E_BIN) $(E2E_ARGS_EXEC) |
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
Oops, something went wrong.