Skip to content

Commit 5633139

Browse files
committed
token usage change
1 parent 658fb42 commit 5633139

File tree

6 files changed

+44
-27
lines changed

6 files changed

+44
-27
lines changed

.c9build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ mvn pmd:pmd
1313
# Test
1414
mvn cobertura:cobertura -Dcobertura.report.format=xml
1515

16-
# Publish
16+
# Push content
17+
18+
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com.
19+
20+
BRANCH_NAME=`git symbolic-ref --short HEAD`
21+
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
22+
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
23+
1724
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
18-
testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml master.c9
25+
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+
target/pmd.xml
2+
[Tests]target/surefire-reports/TEST-TestSuite.xml
3+
target/site/cobertura/coverage.xml

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ script:
66
- mvn pmd:pmd
77
- mvn cobertura:cobertura -Dcobertura.report.format=xml
88

9-
after_script:
9+
# Requires TESTSPACE_TOKEN environment variable.
10+
after_script:
1011
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
11-
- testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
12+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${TRAVIS_REPO_SLUG/\//:}/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
13+

README.md

Lines changed: 16 additions & 17 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
## Java/TestNG sample for demonstrating Testspace
@@ -17,13 +18,11 @@ Using Multiple Online CI Services:
1718
***
1819
Publishing **Test Content** using www.testspace.com.
1920

20-
[![Space Health](https://samples.testspace.com/projects/125/spaces/456/badge)](https://samples.testspace.com/projects/125/spaces/456 "Test Cases")
21-
[![Space Metric](https://samples.testspace.com/projects/125/spaces/456/metrics/299/badge)](https://samples.testspace.com/spaces/456/schema/Code%20Coverage "Code Coverage (branches)")
22-
[![Space Metric](https://samples.testspace.com/projects/125/spaces/456/metrics/301/badge)](https://samples.testspace.com/spaces/456/schema/Code%20Coverage "Code Coverage (methods)")
23-
[![Space Metric](https://samples.testspace.com/projects/125/spaces/456/metrics/333/badge)](https://samples.testspace.com/spaces/456/schema/Static%20Analysis "Static Analysis (issues)")
24-
21+
[![Space Health](https://samples.testspace.com/projects/166/spaces/812/badge)](https://samples.testspace.com/projects/166/spaces/812 "Test Cases")
22+
[![Space Metric](https://samples.testspace.com/projects/166/spaces/812/metrics/775/badge)](https://samples.testspace.com/spaces/812/schema/Code%20Coverage "Code Coverage (branches)")
23+
[![Space Metric](https://samples.testspace.com/projects/166/spaces/812/metrics/777/badge)](https://samples.testspace.com/spaces/812/schema/Code%20Coverage "Code Coverage (methods)")
24+
[![Space Metric](https://samples.testspace.com/projects/166/spaces/812/metrics/778/badge)](https://samples.testspace.com/spaces/812/schema/Static%20Analysis "Static Analysis (issues)")
2525

26-
***
2726

2827
***
2928

@@ -35,19 +34,19 @@ Build examples:
3534
mvn cobertura:cobertura -Dcobertura.report.format=xml
3635
</pre>
3736

38-
Publishing results example:
39-
4037
<pre>
41-
testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
42-
</pre>
38+
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
39+
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
40+
</pre>
4341

44-
Checkout the [Space](https://samples.testspace.com/projects/java.testng).
42+
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:java.testng). 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.
4543

4644
***
4745

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

circle.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ test:
88
- mvn pmd:pmd
99
- mvn cobertura:cobertura -Dcobertura.report.format=xml
1010

11-
post:
11+
# Requires TESTSPACE_TOKEN environment variable.
12+
post:
1213
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
13-
- testspace target/pmd.xml [Tests]target/surefire-reports/TEST*.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
14+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
15+

shippable.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ language: java
22

33
env:
44
global:
5-
- secure: O03yuwaItLGi6RN5EtGokY77oK1BBY+9M8d+l24Mndm+APYtUeFoDySf2YNBrvsja/6sieltU3vCe+G/H+CaMjmxuNCeQJjH78ZZGSIHfGx/XwTVkh1rzDOMEb00qhxqsgSDNNl2XsrK+xC2Z07thdpuW5uLR9qJ1JefRhpa/9ab1h3OvP0FSxE9u+u/WSgK6Q1Wu61i3n8wrw8oG692yS7NsG9NQS+kxU4qMB2dRrYnE4IPJg17VKbcbvVqGao4TBMecg4OJCYahoznCPvwwEPi9tilI+2R7nH6o3vu1KbklHRKCgO4pxv++Zfd8CEC0lR2QwWf955YQYGKda88wQ==
5+
- secure: TokbBjhsgqfY8UbAhepYL2ojZStxaSmVlHfoZQhi4FJEZNTKO3WdxgyNz0tfW88SsqIjHNik8JlAodNieG54zstaSojcszw0zJ4XTUkdxxvjCsgBXGXCu8mVt0wcZUmLKSeX86yY3+NCObE68bGJXhYqW6+WGlK3qvoNlWkBi+IGt3LvmRCDFKttXlzxGKR1pXxLiK0n2l26FCX8blR1hOzKZ4PVGGuvM+6ivJni2WbaHIfUfRDA9AZOto50LwGVjWg74pgq9ekMNMooFz+fWp1aOKzHGL2qs5HDCy4iYzH4PbJD3Njs0Huyq5gc5gSfV7BaEGsTnODu4HsCtwL0HA==
66

77
build:
88
ci:
99
- mvn clean compile
1010
- mvn pmd:pmd
1111
- mvn cobertura:cobertura -Dcobertura.report.format=xml
1212

13-
post_ci:
14-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
15-
- testspace target/pmd.xml [Tests]target/surefire-reports/TEST-TestSuite.xml target/site/cobertura/coverage.xml $TESTSPACE_TOKEN/${BRANCH}#ship.Build.${BUILD_NUMBER}
13+
# Requires TESTSPACE_TOKEN environment variable.
14+
on_success:
15+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
16+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
1617

18+
on_failure:
19+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
20+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}

0 commit comments

Comments
 (0)