-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Refactor and clean up the test runner for "core" tests
Use the same pattern as in the `tests-xpack.sh` runner, ie. run the file directly on host, and execute commands with `docker exec`. Also, clean up a little bit the `tests-xpack.sh` runner, removing double quotes to prevent unwanted shell expansion, and passing the `PACKAGE_PATH` environment variable. (cherry picked from commit 4fbc97d)
- Loading branch information
Showing
4 changed files
with
40 additions
and
35 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
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,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
TIMEFORMAT="(Duration: %0lR)" | ||
|
||
echo -e "\033[1m>>>>> Cleaning up test files\033[0m" | ||
|
||
docker exec go-elasticsearch /bin/sh -c 'rm -rf esapi/test/*_test.go' | ||
docker exec go-elasticsearch /bin/sh -c 'rm -rf esapi/test/xpack' | ||
|
||
echo -e "\033[1m>>>>> Generating the API registry\033[0m" | ||
|
||
docker exec --workdir=/go-elasticsearch/internal/cmd/generate --env PACKAGE_PATH=/go-elasticsearch/esapi go-elasticsearch go generate ./... | ||
|
||
echo -e "\033[1m>>>>> Generating the test files\033[0m" | ||
|
||
time docker exec --tty --workdir=/go-elasticsearch/internal/cmd/generate go-elasticsearch go run main.go tests --output '/go-elasticsearch/esapi/test' --input '/elasticsearch-source/elasticsearch/rest-api-spec/src/main/resources/rest-api-spec/test/**/*.y*ml' | ||
|
||
echo -e "\033[1m>>>>> Running the tests\033[0m" | ||
|
||
time docker exec --tty --workdir=/go-elasticsearch/esapi/test go-elasticsearch /bin/sh -c 'gotestsum --format=short-verbose --junitfile=$WORKSPACE/TEST-integration-api-junit.xml -- -tags=integration -timeout=1h ./...' | ||
status=$? | ||
|
||
exit $status |
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 was deleted.
Oops, something went wrong.