Skip to content

Commit

Permalink
CI updates (#1835
Browse files Browse the repository at this point in the history
* Add jobs for testing missing 8.x branches

* Drop references to acceptance tests

They were removed in 1a22745

* Add myself as a contributor

:sunglasses:

* Clean up shellcheck warnings
  • Loading branch information
JoshMock authored Apr 4, 2023
1 parent ce37b0f commit 996f818
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 19 deletions.
15 changes: 15 additions & 0 deletions .ci/jobs/elastic+elasticsearch-js+8.3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- job:
name: elastic+elasticsearch-js+8.3
display-name: 'elastic / elasticsearch-js # 8.3'
description: Testing the elasticsearch-js 8.3 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/8.3
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
- github
- timed: 'H */12 * * *'
15 changes: 15 additions & 0 deletions .ci/jobs/elastic+elasticsearch-js+8.4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- job:
name: elastic+elasticsearch-js+8.4
display-name: 'elastic / elasticsearch-js # 8.3'
description: Testing the elasticsearch-js 8.4 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/8.4
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
- github
- timed: 'H */12 * * *'
15 changes: 15 additions & 0 deletions .ci/jobs/elastic+elasticsearch-js+8.5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- job:
name: elastic+elasticsearch-js+8.5
display-name: 'elastic / elasticsearch-js # 8.5'
description: Testing the elasticsearch-js 8.5 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/8.5
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
- github
- timed: 'H */12 * * *'
15 changes: 15 additions & 0 deletions .ci/jobs/elastic+elasticsearch-js+8.6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- job:
name: elastic+elasticsearch-js+8.6
display-name: 'elastic / elasticsearch-js # 8.6'
description: Testing the elasticsearch-js 8.6 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/8.6
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
- github
- timed: 'H */12 * * *'
15 changes: 15 additions & 0 deletions .ci/jobs/elastic+elasticsearch-js+8.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- job:
name: elastic+elasticsearch-js+8.7
display-name: 'elastic / elasticsearch-js # 8.7'
description: Testing the elasticsearch-js 8.7 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/8.7
description: the Git branch specifier to build (<branchName>, <tagName>,
<commitId>, etc.)
triggers:
- github
- timed: 'H */12 * * *'
12 changes: 6 additions & 6 deletions .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# TEST_SUITE -- which test suite to run: free or platinum
# ELASTICSEARCH_URL -- The url at which elasticsearch is reachable, a default is composed based on STACK_VERSION and TEST_SUITE
# NODE_JS_VERSION -- node js version (defined in test-matrix.yml, a default is hardcoded here)
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
script_path=$(dirname "$(realpath -s "$0")")
source "$script_path/functions/imports.sh"
set -euo pipefail

NODE_JS_VERSION=${NODE_JS_VERSION-16}
Expand All @@ -24,18 +24,18 @@ echo -e "\033[1m>>>>> Build docker container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0
docker build \
--file .ci/Dockerfile \
--tag elastic/elasticsearch-js \
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
--build-arg NODE_JS_VERSION="${NODE_JS_VERSION}" \
.

echo -e "\033[1m>>>>> NPM run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"

repo=$(realpath $(dirname $(realpath -s $0))/../)
repo=$(realpath "$(dirname "$(realpath -s "$0")")"/../)

docker run \
--network=${network_name} \
--network="${network_name}" \
--env "TEST_ES_SERVER=${ELASTICSEARCH_URL}" \
--env "TEST_SUITE=${TEST_SUITE}" \
--volume $repo:/usr/src/app \
--volume "$repo:/usr/src/app" \
--volume /usr/src/app/node_modules \
--name elasticsearch-js \
--rm \
Expand Down
8 changes: 4 additions & 4 deletions .ci/run-tests
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
#
# Version 1.1
# - Moved to .ci folder and seperated out `run-repository.sh`
# - Moved to .ci folder and separated out `run-repository.sh`
# - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
script_path=$(dirname "$(realpath -s "$0")")
source "$script_path/functions/imports.sh"
set -euo pipefail

echo -e "\033[1m>>>>> Start [$STACK_VERSION container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
Expand All @@ -15,7 +15,7 @@ if [[ -n "$RUNSCRIPTS" ]]; then
echo -e "\033[1m>>>>> Running run-$RUNSCRIPT.sh >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
CONTAINER_NAME=${RUNSCRIPT} \
DETACH=true \
bash .ci/run-${RUNSCRIPT}.sh
bash ".ci/run-${RUNSCRIPT}.sh"
done
fi

Expand Down
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "npm run build && npm run lint && tap test/{unit,acceptance}/{*,**/*}.test.ts",
"test": "npm run build && npm run lint && tap test/unit/{*,**/*}.test.ts",
"test:unit": "npm run build && tap test/unit/{*,**/*}.test.ts",
"test:acceptance": "npm run build && tap test/acceptance/*.test.ts",
"test:coverage-100": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage --100",
"test:coverage-report": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage && nyc report --reporter=text-lcov > coverage.lcov",
"test:coverage-ui": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage --coverage-report=html",
"test:coverage-100": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage --100",
"test:coverage-report": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage && nyc report --reporter=text-lcov > coverage.lcov",
"test:coverage-ui": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage --coverage-report=html",
"test:integration": "tsc && node test/integration/index.js",
"lint": "ts-standard src",
"lint:fix": "ts-standard --fix src",
Expand All @@ -31,10 +30,16 @@
"client",
"index"
],
"author": {
"name": "Tomas Della Vedova",
"company": "Elastic BV"
},
"contributors": [
{
"name": "Tomas Della Vedova",
"company": "Elastic BV"
},
{
"name": "Josh Mock",
"company": "Elastic BV"
}
],
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down

0 comments on commit 996f818

Please sign in to comment.