Skip to content

Commit b803ae1

Browse files
committed
updates for new release
1 parent 044c7de commit b803ae1

File tree

5 files changed

+55
-57
lines changed

5 files changed

+55
-57
lines changed

.c9build.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.
1212
# Test
1313
COVERAGE=true xvfb-run --server-args="-screen 0 1024x768x24" bundle exec rake ci:setup:rspec spec
1414

15-
# Publish
15+
# Download and configure the Testspace client
16+
mkdir -p $HOME/bin
17+
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
18+
# note c9 host requires "access token", storing in ~/.netrc (refer to https://help.testspace.com/reference:client-reference#login-credentials)
19+
CI=true testspace config url samples.testspace.com
1620

17-
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com. Also note that CI_REPORTS is referenced in .testspace.txt
18-
19-
BRANCH_NAME=`git symbolic-ref --short HEAD`
20-
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
21-
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
22-
23-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
24-
CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build
21+
# Push content
22+
# using "list file" because 5 items being pushed
23+
CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt "#c9.Build" --repo git

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ before_install:
99
- "sh -e /etc/init.d/xvfb start"
1010
- sleep 3 # give xvfb some time to start
1111

12+
before_script:
13+
- mkdir -p $HOME/bin
14+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
15+
- testspace config url samples.testspace.com
16+
1217
script:
1318
- gem install bundler
1419
- bundle exec rubocop --format emacs --out tmp/rubocop.txt || true
1520
- bundle exec brakeman -o tmp/brakeman.json
1621
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
17-
1822
- COVERAGE=true bundle exec rake ci:setup:rspec spec
1923

20-
# Requires TESTSPACE_TOKEN environment variable. Also note that CI_REPORTS is referenced in .testspace.txt
21-
after_script:
22-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
23-
- CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${TRAVIS_REPO_SLUG/\//:}/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
24-
24+
after_script:
25+
- CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt

README.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
[![Testspace](http://www.testspace.com/img/Testspace.png)](http://www.testspace.com)
1+
[![Testspace](https://www.testspace.com/img/Testspace.png)](https://www.testspace.com)
22

33
***
44

55
## Ruby/RSpec sample for demonstrating Testspace based on the [everydayrails's repo](https://github.com/everydayrails/rails-4-1-rspec-3-0)
66

77
Sample demonstrates techniques for using Testspace with Ruby code and the [`rspec` test framework](http://rspec.info/) together with [`simplecov` code coverage gem](https://github.com/colszowka/simplecov) and [`selenium-webdriver` gem](https://rubygems.org/gems/selenium-webdriver/).
88

9+
* Using a Testspace Project that is `connected` with this GitHub Repo
10+
* Using 3 Online CI services for demonstration purposes only
11+
* Can review the Results at [testspace-samples:ruby.rspec](https://samples.testspace.com/projects/testspace-samples:ruby.rspec)
12+
* Refer to our [Getting Started](https://help.testspace.com/getting-started) help articles for more information
13+
914
***
1015
Using Multiple Online CI Services:
1116

@@ -17,13 +22,19 @@ Using Multiple Online CI Services:
1722
***
1823
Publishing **Test Content** using www.testspace.com.
1924

20-
[![Space Health](https://samples.testspace.com/spaces/726/badge)](https://samples.testspace.com/spaces/726 "Test Cases")
21-
[![Space Metric](https://samples.testspace.com/spaces/726/metrics/658/badge)](https://samples.testspace.com/spaces/726/schema/Code%20Coverage "Code Coverage (lines)")
22-
[![Space Metric](https://samples.testspace.com/spaces/726/metrics/659/badge)](https://samples.testspace.com/spaces/726/schema/Static%20Analysis "Static Analysis (issues)")
25+
[![Space Health](https://samples.testspace.com/spaces/726/badge?token=8d82eaaa19bc5693497a7d1c517828c343a77168)](https://samples.testspace.com/spaces/726 "Test Cases")
26+
[![Space Metric](https://samples.testspace.com/spaces/726/metrics/658/badge?token=e2c5d9cbca50a6b3a2e891c3ca3631f2bf05e40c)](https://samples.testspace.com/spaces/726/schema/Code%20Coverage "Code Coverage (lines)")
27+
[![Space Metric](https://samples.testspace.com/spaces/726/metrics/659/badge?token=9cc9e80131a7f91629c83ea332f652c1a13bd66d)](https://samples.testspace.com/spaces/726/schema/Static%20Analysis "Static Analysis (issues)")
2328

2429
***
30+
Download and configure the Testspace client
31+
32+
<pre>
33+
mkdir -p $HOME/bin
34+
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
35+
testspace config url samples.testspace.com
36+
</pre>
2537

26-
In order to run this sample you will need a host workstation that supports the [RSpec test framework](http://rspec.info/) with installed `ruby 2.3.0`, `bundler` and `firefox`.
2738

2839
Running Static Analysis:
2940

@@ -41,21 +52,8 @@ export CI_REPORTS=$PWD/spec/reports
4152
COVERAGE=true xvfb-run --server-args="-screen 0 1024x768x24" bundle exec rake ci:setup:rspec spec
4253
</pre>
4354

44-
Pushing Content using **Testspace client**:
55+
Push Content using Testspace client. Note that ".testspace.txt" contains list of items to push.
4556

4657
<pre>
47-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
48-
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
49-
</pre>
50-
51-
52-
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:ruby.rspec). Note that the `.testspace.txt` file contains the [set of files](http://help.testspace.com/how-to:publish-content#publishing-via-content-list-file) to publish.
53-
54-
***
55-
56-
To replicate this sample:
57-
- Setup account at www.testspace.com.
58-
- Create a Environment variable called `TESTSPACE_TOKEN`
59-
- `TESTSPACE_TOKEN` = `[email protected]`
60-
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials)
61-
- To [use Testspace with a CI system](http://help.testspace.com/how-to:add-to-ci-workflow), store `TESTSPACE_TOKEN` as a secure environment variable
58+
testspace @.testspace.txt
59+
</pre>

circle.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
machine:
22
ruby:
33
version: 2.3.1
4-
4+
5+
dependencies:
6+
pre:
7+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
8+
- testspace config url samples.testspace.com
9+
510
test:
611
override:
712
- bundle install
813
- bundle exec rubocop --format emacs --out tmp/rubocop.txt || true
914
- bundle exec brakeman -o tmp/brakeman.json
1015
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
11-
1216
- RAILS_ENV=test COVERAGE=true bundle exec rake ci:setup:rspec spec
1317

14-
# Requires TESTSPACE_TOKEN environment variable. Also note that CI_REPORTS is referenced in .testspace.txt
1518
post:
16-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
17-
- CI_REPORTS=$CIRCLE_TEST_REPORTS testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
19+
- CI_REPORTS=$CIRCLE_TEST_REPORTS testspace @.testspace.txt
1820

shippable.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@ rvm:
66
env:
77
global:
88
- DISPLAY=localhost:1.0
9-
- secure: P1IXQO5Q5aT9SLK0jqCe+y5tt0EarCtc/9FoWcgGGHbEW01RDPBKZCdnqd2Sqe38NDd4YE39lxBSxDkWT6M8Qkg5k1iQNrDOW6ES3cyMQrgpIFsvRegaJUWKGDdZaU+ck+7+QQimxuxeZHMjpBJin0D/Pdeb6o4xciuV8mQlpUDAiaTPxJ+NcLyJvi7MuTPeUl+NXr6zujQUsg94W/+5MrrRxiYRqm002alEHeECXThxVoGCKzpOOQA0bACni7Rjb7rI1leexD1bHd3xnegxfYAmwYGRNqzegav7gS0YRGohVAtDFZQV0iQnMpfUkHKsTI2NW+mFiVj8RDZabWjIpw==
10-
9+
1110
addons:
1211
firefox: "46.0"
1312

1413
services:
1514
- selenium
1615

1716
build:
18-
ci:
19-
- bundle install
20-
- bundle exec rubocop --format emacs --out tmp/rubocop.txt || true
21-
- bundle exec brakeman -o tmp/brakeman.json
22-
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
23-
24-
- COVERAGE=true xvfb-run --server-args="-screen 0 1024x768x24" bundle exec rake ci:setup:rspec spec
17+
ci:
18+
- mkdir -p $HOME/bin
19+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
20+
- testspace config url samples.testspace.com
21+
- bundle install
22+
- bundle exec rubocop --format emacs --out tmp/rubocop.txt || true
23+
- bundle exec brakeman -o tmp/brakeman.json
24+
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
25+
- COVERAGE=true xvfb-run --server-args="-screen 0 1024x768x24" bundle exec rake ci:setup:rspec spec
2526

26-
# Requires TESTSPACE_TOKEN environment variable. Also note that CI_REPORTS is referenced in .testspace.txt
27-
on_success:
28-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
29-
- CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
27+
on_success:
28+
- CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt
3029

31-
on_failure:
32-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
33-
- CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
30+
on_failure:
31+
- CI_REPORTS=$PWD/spec/reports testspace @.testspace.txt

0 commit comments

Comments
 (0)