Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--color
--require spec_helper
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Style/Documentation:

Style/FileName:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false
9 changes: 8 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
source "https://rubygems.org"

gem "serverspec", "~> 2.18.0"
gem "serverspec"
gem "docker-api", "~> 1.21.4"
gem "specinfra", "2.12.7" # because of https://circleci.com/docs/docker#docker-exec
# Also read https://workshop.avatarnewyork.com/post/test-docker-images-with-circleci/

group :development do
gem "guard", "~> 2.12.6"
gem "guard-rubocop", "~> 1.2.0"
gem "rubocop", "~> 0.32.0"
end

group :ci do
gem "yarjuf", "~> 2.0.0"
gem "coveralls", "~> 0.8.1", require: false
end
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
selenium-docker-poc
===

[![Circle CI](https://circleci.com/gh/smoll/selenium-docker-poc.svg?style=svg)](https://circleci.com/gh/smoll/selenium-docker-poc)
[![Circle CI](https://circleci.com/gh/smoll/selenium-docker-poc.svg?style=svg)](https://circleci.com/gh/smoll/selenium-docker-poc) [![Coverage Status](https://coveralls.io/repos/smoll/selenium-docker-poc/badge.svg)](https://coveralls.io/r/smoll/selenium-docker-poc)

Attempting to TDD a Dockerfile for use in parallel browser testing

Expand Down
9 changes: 5 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ machine:
- docker

dependencies:
pre:
- bundle
override:
- docker info
- bundle install

test:
override:
- bundle exec rspec
- bundle exec rspec -f JUnit -o results.xml
post:
- mkdir -p $CIRCLE_TEST_REPORTS/rspec/
- find . -type f -name "results.xml" -exec cp {} $CIRCLE_TEST_REPORTS/rspec/ \;

# TODO: add deployment to docker hub when this is ready https://circleci.com/docs/docker
12 changes: 10 additions & 2 deletions spec/Dockerfile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
require "serverspec"
require "docker"

# Workaround needed for circleCI
# Read https://workshop.avatarnewyork.com/post/test-docker-images-with-circleci/
if ENV["CIRCLECI"]
class Docker::Container
def remove(_options = {}); end
alias_method :delete, :remove
end
end

describe "Dockerfile" do
before(:all) do
image = Docker::Image.build_from_dir "."
Expand All @@ -14,7 +22,7 @@
expect(os_version).to include "Ubuntu 14"
end

it "installs required packages" do
xit "installs required packages" do
expect(package("phantomjs")).to be_installed
end

Expand Down
8 changes: 8 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "serverspec"

if ENV["CI"]
require "coveralls"
require "yarjuf"

Coveralls.wear!
end