This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
forked from elastic/apm-agent-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Run cucumber specs (elastic#886)
- Loading branch information
1 parent
a9ada6a
commit ee0fbdd
Showing
5 changed files
with
74 additions
and
3 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,17 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
specific_feature=$1 | ||
|
||
export CUCUMBER_PUBLISH_QUIET=true | ||
|
||
if [[ $specific_feature = '' ]]; then | ||
echo 'Running all features' | ||
|
||
echo "========================================" | ||
cucumber | ||
else | ||
echo "Running only $specific_feature" | ||
|
||
cucumber $specific_feature | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Test the given docker ruby image. Optionally to filter what test | ||
# to be triggered otherwise all of them. | ||
# | ||
# NOTE: It's required to be launched inside the root of the project. | ||
# | ||
# Usage: | ||
# All feature files: ./spec/scripts/features.sh jruby:9.1 sinatra-2.0 | ||
# One feature file: ./spec/scripts/features.sh jruby:9.1 sinatra-2.0 "features/step_definitions/stepdefs.rb" | ||
# | ||
set -ex | ||
|
||
if [ $# -lt 1 ]; then | ||
echo "Arguments missing" | ||
exit 2 | ||
fi | ||
|
||
IMAGE_NAME=${1} | ||
TEST=${2} | ||
VERSION=$(echo "${IMAGE_NAME}" | cut -d":" -f2) | ||
|
||
cd spec | ||
|
||
IMAGE_NAME=${IMAGE_NAME} RUBY_VERSION=${VERSION} USER_ID="$(id -u):$(id -g)" docker-compose up -d mongodb | ||
|
||
## Customise the docker container to enable the access to the internal of the jdk | ||
## for the jruby docker images. | ||
JDK_JAVA_OPTIONS='' | ||
JRUBY_OPTS='' | ||
if [[ $RUBY_IMAGE == *"jruby"* ]]; then | ||
# https://github.com/jruby/jruby/issues/4834#issuecomment-343371742 | ||
JDK_JAVA_OPTIONS="--illegal-access=permit $(echo --add-opens=java.base/{java.lang,java.security,java.util,java.security.cert,java.util.zip,java.lang.reflect,java.util.regex,java.net,java.io,java.lang}=ALL-UNNAMED)" | ||
JRUBY_OPTS="--debug" | ||
fi | ||
|
||
CLEAN_IMAGE_NAME=$(echo $IMAGE_NAME | sed s/:/-/ ) | ||
|
||
docker build --build-arg "RUBY_IMAGE=${IMAGE_NAME}" -t "apm-agent-ruby:${VERSION}" . | ||
|
||
IMAGE_NAME=${IMAGE_NAME} RUBY_VERSION=${VERSION} USER_ID="$(id -u):$(id -g)" \ | ||
docker-compose -f ../docker-compose.yml run \ | ||
-e INCLUDE_SCHEMA_SPECS=1 \ | ||
-e JDK_JAVA_OPTIONS="${JDK_JAVA_OPTIONS}" \ | ||
-e JRUBY_OPTS="${JRUBY_OPTS}" \ | ||
-e HOME="/tmp" \ | ||
-v "$(dirname "$(pwd)"):/app" \ | ||
-w /app \ | ||
--rm ruby_rspec \ | ||
/bin/bash -c "\ | ||
gem install rake && \ | ||
bundle update && \ | ||
timeout -s9 15m bin/run-bdd ${TEST}" |