Ruby/RSpec sample for demonstrating Testspace based on the everydayrails's repo
Sample demonstrates techniques for using Testspace with Ruby code and the rspec
test framework together with simplecov
code coverage gem and selenium-webdriver
gem.
Using Multiple Online CI Services:
Publishing Test Content using www.testspace.com.
In order to run this sample you will need a host workstation that supports the RSpec test framework with installed ruby 2.3.0
, bundler
and firefox
.
Running Static Analysis:
bundle install bundle exec rubocop --format emacs --out tmp/rubocop.txt bundle exec brakeman -o tmp/brakeman.json bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
Running Tests with Code Coverage:
export CI_REPORTS=$PWD/spec/reports COVERAGE=true xvfb-run --server-args="-screen 0 1024x768x24" bundle exec rake ci:setup:rspec spec
Pushing Content using Testspace client:
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
Checkout the published Test Content. Note that the .testspace.txt
file contains the set of files to publish.
To replicate this sample:
- Setup account at www.testspace.com.
- Create a Environment variable called
TESTSPACE_TOKEN
TESTSPACE_TOKEN
=[email protected]
credentials
set tousername:password
or your access token- To use Testspace with a CI system, store
TESTSPACE_TOKEN
as a secure environment variable