Skip to content

Commit 87b6aaa

Browse files
committed
updated token pattern
1 parent d910063 commit 87b6aaa

File tree

6 files changed

+42
-23
lines changed

6 files changed

+42
-23
lines changed

.c9build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ npm install
66
# Analysis and Test
77
make lint test
88

9-
# Publish
9+
# Push content
10+
11+
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com.
12+
13+
BRANCH_NAME=`git symbolic-ref --short HEAD`
14+
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
15+
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
16+
1017
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
11-
testspace checkstyle.xml [Tests]xunit.xml{test} coverage/cobertura-coverage.xml master.c9
18+
testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build

.testspace.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
checkstyle.xml
2+
[Tests]xunit.xml{test}
3+
coverage/cobertura-coverage.xml

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ before_script:
88
script:
99
- make lint test
1010

11+
# Requires TESTSPACE_TOKEN environment variable.
1112
after_script:
1213
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
13-
- testspace checkstyle.xml [Tests]xunit.xml{test} coverage/cobertura-coverage.xml $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
14+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${TRAVIS_REPO_SLUG/\//:}/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
15+

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![Testspace](http://www.testspace.com/public/img/testspace_logo.png)](http://www.testspace.com)
1+
[![Testspace](http://www.testspace.com/img/Testspace.png)](http://www.testspace.com)
2+
23
***
34

45
## JavaScript/Mocha sample for demonstrating Testspace based on the [nodejs-tdd-boilerplate](https://github.com/BryanDonovan/nodejs-tdd-boilerplate)
@@ -17,10 +18,10 @@ Using Multiple Online CI Services:
1718
***
1819
Publising **Test Content** using www.testspace.com
1920

20-
[![Space Health](https://samples.testspace.com/projects/117/spaces/468/badge)](https://samples.testspace.com/projects/117/spaces/468 "Test Cases")
21-
[![Space Metric](https://samples.testspace.com/projects/117/spaces/468/metrics/340/badge)](https://samples.testspace.com/spaces/468/schema/Code%20Coverage "Code Coverage (branches)")
22-
[![Space Metric](https://samples.testspace.com/projects/117/spaces/468/metrics/342/badge)](https://samples.testspace.com/spaces/468/schema/Code%20Coverage "Code Coverage (methods)")
23-
[![Space Metric](https://samples.testspace.com/projects/117/spaces/468/metrics/343/badge)](https://samples.testspace.com/spaces/468/schema/Static%20Analysis "Static Analysis (issues)")
21+
[![Space Health](https://samples.testspace.com/projects/164/spaces/799/badge)](https://samples.testspace.com/projects/164/spaces/799 "Test Cases")
22+
[![Space Metric](https://samples.testspace.com/projects/164/spaces/799/metrics/743/badge)](https://samples.testspace.com/spaces/799/schema/Code%20Coverage "Code Coverage (branches)")
23+
[![Space Metric](https://samples.testspace.com/projects/164/spaces/799/metrics/745/badge)](https://samples.testspace.com/spaces/799/schema/Code%20Coverage "Code Coverage (methods)")
24+
[![Space Metric](https://samples.testspace.com/projects/164/spaces/799/metrics/746/badge)](https://samples.testspace.com/spaces/799/schema/Static%20Analysis "Static Analysis (issues)")
2425

2526
***
2627

@@ -31,19 +32,19 @@ npm install
3132
make lint test
3233
</pre>
3334

34-
Publishing results example:
35-
3635
<pre>
3736
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
38-
testspace checkstyle.xml [Tests]xunit.xml{test} coverage/cobertura-coverage.xm $TESTSPACE_TOKEN/$BRANCH_NAME
37+
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
3938
</pre>
4039

41-
Checkout the [Space](http://samples.testspace.com/projects/javascript.mocha).
40+
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:javascript.mocha). 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.
4241

4342
***
43+
4444
To replicate this sample:
45-
- Account at www.testspace.com.
46-
- CI Environment Variable called **TESTSPACE_TOKEN** required:
47-
- `TESTSPACE_TOKEN` = `[email protected]/my-project`
48-
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials).
49-
- `my-org-name.testspace.com/my-project` based on your *organization* (subdomain) and *project* names.
45+
- Setup account at www.testspace.com.
46+
- Create a Environment variable called `TESTSPACE_TOKEN`
47+
- `TESTSPACE_TOKEN` = `[email protected]`
48+
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials)
49+
- 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
50+

circle.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ test:
66
override:
77
- npm install
88
- make lint test
9-
9+
10+
# Requires TESTSPACE_TOKEN environment variable.
1011
post:
1112
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
12-
- testspace checkstyle.xml [Tests]xunit.xml{test} coverage/cobertura-coverage.xml $TESTSPACE_TOKEN/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
13+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}

shippable.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ node_js:
55

66
env:
77
global:
8-
- secure: a9cYRKZdEIwS+F1qiz5RvUAOv/sC4tUtv4gtvkiMlPhAvLpDwN/HY4TvCgvJoFRTEy/tbqJWrT58kxzKiojo5N3Fz9L30V7IWzlT2v9NTBcUp7EJ+3nz3cReH4UNCKZCHJJ+tOLQqermycrDIiQWmLB5YycTvHtZf31QxNGPtg9xGG3UL7F/X+5FrvcDi8zuHQZA5Ndjn4TDiN7RDXcZmKmu8KKbZMaA6tSe3C1i3QBvMoXS5R8nsBTfjkHPOkoYwdV87+5WVghnKSc5wkgFSgzsBMEdWNkyE7O/mN07AM/bNLQZdGh9NEozfT6LYTiLXrV55T6nsHdr92ioLLVcmA==
8+
- secure: tSsmixzDVtqCM09eNDK1fJU6j7MSi3WhnDjTR7RI7WZLNpzuVglHnF2ThURPLaFDhFCAcfK+dt/crDI/R6YCa2aVOU9j6qn4zTt6HZHyG2zA89GWgg/h3D+RtAVasoPfP5WE3wvmnGtPyrXQVAk+wEN3ZvnXlD1TAAosZ/OlMQACW8iaZ1zPXVLeC7/KKtghGl/Cg15Y2RrzuiTa5FvPfibU1b8I/s4L5N2JsF666J/IZzT4+QlNv5YMd2FTwTOMLGHLI3Qq+NwYkRaQapdXYk5tIVu3M1hz7dK1IuBLfRUuoaHHDsY7dviH8rOSXYXtouf30dZILAt1IrIz3opFhg==
99

1010
build:
1111
ci:
1212
- npm install
1313
- make lint test
1414

15-
post_ci:
16-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
17-
- testspace checkstyle.xml [Tests]xunit.xml{test} coverage/cobertura-coverage.xml $TESTSPACE_TOKEN/${BRANCH}#ship.Build.${BUILD_NUMBER}
15+
# Requires TESTSPACE_TOKEN environment variable.
16+
on_success:
17+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
18+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
19+
20+
on_failure:
21+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
22+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}

0 commit comments

Comments
 (0)