Skip to content

Commit cc39497

Browse files
committed
[CI] Adds YAML test runner task to Buildkite
1 parent 72335d6 commit cc39497

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ steps:
6161
# I'm publishing test results to HTML and JUnit in this directory and this directive makes them
6262
# available in the Artifacts tab of a build in Buildkite.
6363
artifact_paths: "elasticsearch-api/tmp/*"
64+
- label: ":ruby: :yaml: Test suite"
65+
agents:
66+
provider: "gcp"
67+
env:
68+
RUBY_VERSION: "3.3"
69+
STACK_VERSION: 8.15.0-SNAPSHOT
70+
TRANSPORT_VERSION: "8.3"
71+
RUBY_SOURCE: "ruby"
72+
TEST_SUITE: "platinum"
73+
command: ./.buildkite/run-yaml-tests.sh
6474
- wait: ~
6575
continue_on_failure: true
6676
- label: "Log Results"

.buildkite/run-yaml-tests.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Script to run YAML runner integration tests on Buildkite
4+
#
5+
# Version 0.1
6+
#
7+
script_path=$(dirname $(realpath -s $0))
8+
source $script_path/functions/imports.sh
9+
set -euo pipefail
10+
repo=`pwd`
11+
12+
echo "--- :elasticsearch: Starting Elasticsearch"
13+
DETACH=true bash $script_path/run-elasticsearch.sh
14+
15+
export RUBY_VERSION=${RUBY_VERSION:-3.1}
16+
export TRANSPORT_VERSION=${TRANSPORT_VERSION:-8}
17+
18+
echo "--- :ruby: Building Docker image"
19+
docker build \
20+
--file $script_path/Dockerfile \
21+
--tag elastic/elasticsearch-ruby \
22+
--build-arg RUBY_VERSION=$RUBY_VERSION \
23+
--build-arg TRANSPORT_VERSION=$TRANSPORT_VERSION \
24+
--build-arg RUBY_SOURCE=$RUBY_SOURCE \
25+
.
26+
27+
mkdir -p elasticsearch-api/tmp
28+
29+
echo "--- :ruby: Running :yaml: tests"
30+
docker run \
31+
-u "$(id -u)" \
32+
--network="${network_name}" \
33+
--env "TEST_ES_SERVER=${elasticsearch_url}" \
34+
--env "ELASTIC_PASSWORD=${elastic_password}" \
35+
--env "ELASTIC_USER=elastic" \
36+
--env "BUILDKITE=true" \
37+
--env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
38+
--env "STACK_VERSION=${STACK_VERSION}" \
39+
--volume $repo:/usr/src/app \
40+
--name elasticsearch-ruby \
41+
--rm \
42+
elastic/elasticsearch-ruby \
43+
bundle exec rake test:yaml

rake_tasks/test_tasks.rake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ namespace :test do
6161
puts "\n"
6262
end
6363

64+
desc 'Run YAML test runner tests'
65+
task :yaml do
66+
sh "cd #{CURRENT_PATH.join('elasticsearch-api')} && unset BUNDLE_GEMFILE && bundle exec rake test:yaml"
67+
end
68+
6469
namespace :platinum do
6570
desc 'Run platinum integration tests'
6671
task :integration do

0 commit comments

Comments
 (0)