Skip to content

Commit 7561bab

Browse files
committed
updates for new release
1 parent 1f0d557 commit 7561bab

File tree

6 files changed

+47
-52
lines changed

6 files changed

+47
-52
lines changed

.c9build.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ bundle exec scss-lint --no-color --format=Stats --format=Default --out=tmp/scss-
1313
# Test
1414
bundle exec rake minitest test
1515

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

19-
# Publish
20-
21-
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com. Also note that CI_REPORTS is referenced in .testspace.txt
22-
BRANCH_NAME=`git symbolic-ref --short HEAD`
23-
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
24-
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
25-
26-
CI_REPORTS=$PWD/test/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build
22+
# Push content
23+
# using "list file" because 5 items being pushed
24+
testspace @.testspace.txt "#c9.Build" --repo git

.testspace.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
tmp/rubocop.txt{lint}
33
tmp/brakeman_checkstyle.xml
44
tmp/scss-lint.txt{lint}
5-
[Tests]$CI_REPORTS/TEST*.xml{test}
5+
[Tests]$PWD/test/reports/TEST*.xml{test}
66
coverage/coverage.xml

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ language:
33

44
rvm:
55
- 2.3.1
6+
7+
before_script:
8+
- mkdir -p $HOME/bin
9+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
10+
- testspace config url samples.testspace.com
611

712
script:
813
- bundle install
914
- bundle exec rubocop --format emacs --out tmp/rubocop.txt || true
1015
- bundle exec brakeman -o tmp/brakeman.json
1116
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
1217
- bundle exec scss-lint --no-color --format=Stats --format=Default --out=tmp/scss-lint.txt app/assets/stylesheets/ || true
13-
1418
- bundle exec rake minitest test
1519

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

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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

@@ -7,6 +7,11 @@
77
This is the sample application for the [*Ruby on Rails Tutorial: Learn Web Development with Rails*](http://www.railstutorial.org/) by [Michael Hartl](http://www.michaelhartl.com/). It is being used to demonstrate publishing test content to Testspace.
88
We have made a few minor modifications to original project for publishing.
99

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

@@ -18,12 +23,19 @@ Using Multiple Online CI Services:
1823
***
1924
**Test Content** published to www.testspace.com.
2025

21-
[![Space Health](https://samples.testspace.com/spaces/676/badge)](https://samples.testspace.com/spaces/676 "Test Cases")
22-
[![Space Metric](https://samples.testspace.com/spaces/676/metrics/604/badge)](https://samples.testspace.com/spaces/676/schema/Code%20Coverage "Code Coverage (lines)")
23-
[![Space Metric](https://samples.testspace.com/spaces/676/metrics/605/badge)](https://samples.testspace.com/spaces/676/schema/Static%20Analysis "Static Analysis (issues)")
26+
[![Space Health](https://samples.testspace.com/spaces/676/badge?token=684631c7573f9c1b24ae5b5b3ff3279ffb5130e6)](https://samples.testspace.com/spaces/676 "Test Cases")
27+
[![Space Metric](https://samples.testspace.com/spaces/676/metrics/604/badge?token=747a8f49a00ccb7f52774fefe880135fad079fd3)](https://samples.testspace.com/spaces/676/schema/Code%20Coverage "Code Coverage (lines)")
28+
[![Space Metric](https://samples.testspace.com/spaces/676/metrics/605/badge?token=df4662fc7ddf431c04dc95a79716fae91346d3dc)](https://samples.testspace.com/spaces/676/schema/Static%20Analysis "Static Analysis (issues)")
2429

2530
***
26-
To run this sample you will need a host workstation that supports the [Minitest test framework](http://docs.seattlerb.org/minitest/).
31+
32+
Download and configure the Testspace client
33+
34+
<pre>
35+
mkdir -p $HOME/bin
36+
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
37+
testspace config url samples.testspace.com
38+
</pre>
2739

2840

2941
Running Static Analysis:
@@ -39,24 +51,11 @@ bundle exec scss-lint --no-color --format=Stats --format=Default --out=tmp/scss-
3951
Running Tests with Code Coverage:
4052

4153
<pre>
42-
export CI_REPORTS=$PWD/test/reports
4354
bundle exec rake minitest test
4455
</pre>
4556

46-
Push Content using **Testspace client**:
57+
Push Content using Testspace client. Note that ".testspace.txt" contains list of items to push.
4758

4859
<pre>
49-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
50-
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
60+
testspace @.testspace.txt
5161
</pre>
52-
53-
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:ruby.minitest). 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.
54-
55-
***
56-
57-
To replicate this sample:
58-
- Setup account at www.testspace.com.
59-
- Create an environment variable called `TESTSPACE_TOKEN`
60-
- `TESTSPACE_TOKEN` = `[email protected]`
61-
- Set `credentials` to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials)
62-
- 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

circle.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
machine:
22
ruby:
33
version: 2.3.1
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
49

510
test:
611
override:
@@ -9,10 +14,7 @@ test:
914
- bundle exec brakeman -o tmp/brakeman.json
1015
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
1116
- bundle exec scss-lint --no-color --format=Stats --format=Default --out=tmp/scss-lint.txt app/assets/stylesheets/ || true
12-
1317
- bundle exec rake minitest test
1418

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

shippable.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,20 @@
33
rvm:
44
- 2.3.1
55

6-
env:
7-
global:
8-
- secure: NdeNVBv2zZpGOUoORIRuy0qAu6GvILMUgEtTUB2cBM+4lXUErSbSYblp0ijcMmE50F8yI5HO1FJJUnyTnHZ6KXrcbYDB7iUBldXRiGjEkSWjcd5nJLL7N/CnSnwaP9UJnRKplYJOGhjAwpIC2jl17qPT2E1nFkbrlasORkuRaUKCdlVwe4T7t3brQd+Bia+UFh096dG2y0dt0o9lQWwp+yaYc6J6dWIeCfQDzbccL8sLEv64VL0SwRR4j8NhzutAWezS285qfIj2CSLYlgI/d2nxoW8MqXBZpAroYbIBkUeaWdaKIMJ7NvArlGIJQVuluT4Pa5qpjPgmXe8wdZK8mQ==
9-
106
build:
117
ci:
8+
- mkdir -p $HOME/bin
9+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
10+
- testspace config url samples.testspace.com
1211
- bundle install
1312
- bundle exec rubocop --format emacs --out tmp/rubocop.txt || true
1413
- bundle exec brakeman -o tmp/brakeman.json
1514
- bundle exec brakeman_translate_checkstyle_format translate --file="tmp/brakeman.json" > tmp/brakeman_checkstyle.xml
1615
- bundle exec scss-lint --no-color --format=Stats --format=Default --out=tmp/scss-lint.txt app/assets/stylesheets/ || true
17-
1816
- bundle exec rake minitest test
1917

20-
# Requires TESTSPACE_TOKEN environment variable. Also note that CI_REPORTS is referenced in .testspace.txt
21-
# Both on_success and on_failure are required so the test results are published to Testspace no matter what happens in build.
22-
on_success:
23-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
24-
- CI_REPORTS=$PWD/test/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
18+
on_success:
19+
- testspace @.testspace.txt
2520

26-
on_failure:
27-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
28-
- CI_REPORTS=$PWD/test/reports testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
21+
on_failure:
22+
- testspace @.testspace.txt

0 commit comments

Comments
 (0)