Skip to content

Commit a315ec8

Browse files
author
Andrew Hampe
committed
Support running in Jenkins
1 parent f36d8ae commit a315ec8

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ coverage
77
doc/
88
.ruby-version
99
.idea/
10+
*.iml
1011
.git/
1112
.gitignore
13+
14+
# Jenkins/Docker
15+
results/
16+
Dockerfile.test

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ coverage
77
doc/
88
.ruby-version
99
.idea/
10+
*.iml
11+
12+
# Jenkins/Docker
13+
results/

Dockerfile.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ WORKDIR /fauna/faunadb-ruby
2020
RUN bundle install
2121

2222
# Define the default variables for the tests
23-
ENV FAUNA_ROOT_KEY=secret FAUNA_DOMAIN=db.fauna.com FAUNA_SCHEME=https FAUNA_PORT=443
23+
ENV FAUNA_ROOT_KEY=secret FAUNA_DOMAIN=db.fauna.com FAUNA_SCHEME=https FAUNA_PORT=443 FAUNA_TIMEOUT=30s
2424

2525
# Run the tests (after target database is up)
26-
ENTRYPOINT dockerize -wait "$FAUNA_SCHEME://$FAUNA_DOMAIN:$FAUNA_PORT/ping" -timeout 30s bundle exec rake spec
26+
CMD ["make", "docker-wait", "test"]

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ ifdef FAUNA_PORT
1717
DOCKER_RUN_FLAGS += -e FAUNA_PORT=$(FAUNA_PORT)
1818
endif
1919

20+
ifdef FAUNA_TIMEOUT
21+
DOCKER_RUN_FLAGS += -e FAUNA_TIMEOUT=$(FAUNA_TIMEOUT)
22+
endif
23+
24+
test:
25+
bundle exec rake spec
26+
27+
jenkins-test:
28+
bundle exec rspec --format progress --format RspecJunitFormatter --out results/report.xml
29+
30+
docker-wait:
31+
dockerize -wait $(FAUNA_SCHEME)://$(FAUNA_DOMAIN):$(FAUNA_PORT)/ping -timeout $(FAUNA_TIMEOUT)
32+
2033
docker-test:
2134
docker build -f Dockerfile.test -t faunadb-ruby-test:latest --build-arg RUNTIME_IMAGE=$(RUNTIME_IMAGE) .
2235
docker run $(DOCKER_RUN_FLAGS) faunadb-ruby-test:latest

fauna.gemspec

+1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ Gem::Specification.new do |s|
2323
s.add_development_dependency 'rspec', '~> 3.4'
2424
s.add_development_dependency 'rubocop', '~> 0.38.0'
2525
s.add_development_dependency 'codecov', '~> 0.1.5'
26+
s.add_development_dependency 'rspec_junit_formatter', '~> 0.3.0'
2627
end

0 commit comments

Comments
 (0)