Skip to content

Commit 52bc952

Browse files
committed
CI pattern updates
1 parent 461e739 commit 52bc952

File tree

6 files changed

+31
-17
lines changed

6 files changed

+31
-17
lines changed

.c9build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@ pylint stock_alerter/ -f parseable > analysis.txt
1111
nose2 --junit-xml --with-coverage
1212

1313
# Publish
14+
15+
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com.
16+
17+
BRANCH_NAME=`git symbolic-ref --short HEAD`
18+
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
19+
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
20+
1421
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
15-
testspace analysis.txt{issues} nose2.xml{stock_alerter} coverage.xml master.c9
22+
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+
analysis.txt{issues}
2+
nose2.xml{stock_alerter}
3+
coverage.xml

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ script:
1212
- pylint stock_alerter/ -f parseable > analysis.txt || true
1313
- nose2 --junit-xml --with-coverage
1414

15+
# Requires TESTSPACE_TOKEN environment variable.
1516
after_script:
1617
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
17-
- testspace analysis.txt{issues} nose2.xml{stock_alerter} coverage.xml $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
18-
18+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${TRAVIS_REPO_SLUG/\//:}/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
19+

README.md

Lines changed: 13 additions & 12 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
## Python/Unittest sample for demonstrating Testspace based on the [test_driven_python repo](https://github.com/siddhi/test_driven_python)
@@ -16,10 +17,9 @@ Using Multiple Online CI Services:
1617
***
1718
Publishing **Test Content** using www.testspace.com.
1819

19-
[![Space Health](https://samples.testspace.com/projects/120/spaces/444/badge)](https://samples.testspace.com/projects/120/spaces/444 "Test Cases")
20-
[![Space Metric](https://samples.testspace.com/projects/120/spaces/444/metrics/272/badge)](https://samples.testspace.com/spaces/444/schema/Code%20Coverage "Code Coverage (lines)")
21-
[![Space Metric](https://samples.testspace.com/projects/120/spaces/444/metrics/274/badge)](https://samples.testspace.com/spaces/444/schema/Static%20Analysis "Static Analysis (issues)")
22-
20+
[![Space Health](https://samples.testspace.com/projects/161/spaces/757/badge)](https://samples.testspace.com/projects/161/spaces/757 "Test Cases")
21+
[![Space Metric](https://samples.testspace.com/projects/161/spaces/757/metrics/683/badge)](https://samples.testspace.com/spaces/757/schema/Code%20Coverage "Code Coverage (lines)")
22+
[![Space Metric](https://samples.testspace.com/projects/161/spaces/757/metrics/684/badge)](https://samples.testspace.com/spaces/757/schema/Static%20Analysis "Static Analysis (issues)")
2323

2424
***
2525

@@ -49,15 +49,16 @@ Publishing Results using **Testspace**:
4949

5050
<pre>
5151
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
52-
testspace analysis.txt{issues} nose2.xml{stock_alerter} coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
52+
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
5353
</pre>
5454

55-
Checkout the [Space](https://samples.testspace.com/projects/python.unittest).
55+
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:python.unittest). 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.
5656

5757
***
58+
5859
To replicate this sample:
59-
- Account at www.testspace.com.
60-
- CI Environment Variable called **TESTSPACE_TOKEN** required:
61-
- `TESTSPACE_TOKEN` = `credentials@my-org-name.testspace.com/my-project`
62-
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials).
63-
- `my-org-name.testspace.com/my-project` based on your *organization* (subdomain) and *project* names.
60+
- Setup account at www.testspace.com.
61+
- Create a Environment variable called `TESTSPACE_TOKEN`
62+
- `TESTSPACE_TOKEN` = `credentials@Your-Org-Name.testspace.com`
63+
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials)
64+
- To [use](http://help.testspace.com/how-to:add-to-ci) Testspace in a CI system, store `TESTSPACE_TOKEN` as a secure environment variable

circle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ test:
1212
- pylint stock_alerter/ -f parseable > analysis.txt || true
1313
- nose2 --junit-xml --with-coverage
1414

15+
# Requires TESTSPACE_TOKEN environment variable.
1516
post:
1617
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
17-
- testspace analysis.txt{issues} nose2.xml{stock_alerter} coverage.xml $TESTSPACE_TOKEN/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
18+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}

shippable.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ build:
1414
- pylint stock_alerter/ -f parseable > analysis.txt || true
1515
- nose2 --junit-xml --with-coverage
1616

17+
# Requires TESTSPACE_TOKEN environment variable.
1718
post_ci:
1819
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
19-
- testspace analysis.txt{issues} nose2.xml{stock_alerter} coverage.xml $TESTSPACE_TOKEN/${BRANCH}#ship.Build.${BUILD_NUMBER}
20+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}

0 commit comments

Comments
 (0)