Skip to content

Commit ee812f1

Browse files
committed
updated to connected project
1 parent 0dea29f commit ee812f1

File tree

7 files changed

+45
-27
lines changed

7 files changed

+45
-27
lines changed

.c9build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ $GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
4343
rm -f coverage.xml
4444
gcovr --root ./ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
4545

46+
# Push content
47+
48+
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com.
49+
50+
BRANCH_NAME=`git symbolic-ref --short HEAD`
51+
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
52+
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
4653

47-
# Publish
4854
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
49-
# assuming testspace is already configured with "credentials@domain/project"
50-
testspace build.log{issues} [Tests]sample*.xml coverage.xml master.c9
55+
testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
!.travis.yml
1111
!shippable.yml
1212
!circle.yml
13-
!.c9build.sh
13+
!.c9build.sh
14+
!.testspace.txt

.testspace.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build.log{issues}
2+
[Tests]sample*.xml
3+
coverage.xml

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ script:
3131
- $GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
3232
- gcovr --root ./ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
3333

34-
after_script:
34+
# Requires TESTSPACE_TOKEN environment variable.
35+
after_script:
3536
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
36-
- testspace build.log{issues} [Tests]sample*.xml coverage.xml $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
37+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${TRAVIS_REPO_SLUG/\//:}/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}

README.md

Lines changed: 15 additions & 13 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
## C++/Google Test sample for demonstrating Testspace
@@ -16,9 +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/123/spaces/452/badge)](https://samples.testspace.com/projects/123/spaces/452 "Test Cases")
20-
[![Space Metric](https://samples.testspace.com/projects/123/spaces/452/metrics/289/badge)](https://samples.testspace.com/spaces/452/schema/Code%20Coverage "Code Coverage (lines)")
21-
[![Space Metric](https://samples.testspace.com/projects/123/spaces/452/metrics/358/badge)](https://samples.testspace.com/spaces/452/schema/Static%20Analysis "Static Analysis (issues)")
20+
[![Space Health](https://samples.testspace.com/projects/169/spaces/827/badge)](https://samples.testspace.com/projects/169/spaces/827 "Test Cases")
21+
[![Space Metric](https://samples.testspace.com/projects/169/spaces/827/metrics/819/badge)](https://samples.testspace.com/spaces/827/schema/Code%20Coverage "Code Coverage (lines)")
22+
[![Space Metric](https://samples.testspace.com/projects/169/spaces/827/metrics/817/badge)](https://samples.testspace.com/spaces/827/schema/Static%20Analysis "Static Analysis (issues)")
2223

2324
***
2425

@@ -39,20 +40,21 @@ $GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
3940
gcovr --root ../ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
4041
</pre>
4142

42-
Publish **`test results`** along with **`static analysis`** and **`code coverage`**
43+
Push Content using **Testspace client**:
4344

4445
<pre>
4546
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
46-
testspace build.log{issues} [Tests]sample*.xml build/coverage.xml $TESTSPACE_TOKEN/$BRANCH_NAME
47-
</pre>
47+
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
48+
</pre>
4849

49-
Checkout the [Space](https://samples.testspace.com/projects/cpp.googletest).
50+
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:cpp.googletest). 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.
5051

5152
***
5253

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

circle.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ test:
2424
- $GTEST_ROOT/build/sample9_unittest --gtest_output=xml:sample9.xml
2525
- $GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
2626
- gcovr --root ./ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
27-
post:
28-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
29-
- testspace build.log{issues} [Tests]sample*.xml coverage.xml $TESTSPACE_TOKEN/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
27+
28+
# Requires TESTSPACE_TOKEN environment variable.
29+
post:
30+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
31+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
32+

shippable.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: c
22

33
env:
44
global:
5-
- secure: Guv8JrTD70i5/YZQJxIJH/lcSsezkbwiEy/ePcMm2grd3I08XlGMXRCod+IjMHqVe3Tv8X4CPOgebCcluCjmHjV2110JfohGLNgZK99VTxDqYrfCJNtXxwwr8iQmliqPCCl+EDlzZ7Mx0Tqr8uBAWOkHTXYwRqUdElUY4WHjj8WDYIYaG/Nc8u4Ev7r4byydSfIBYOeu5bmxuXPDECgtv3Bv6iiRaPT9WfQ6xpgr5JiHzlrBOtMQul5CbduLxwz2J6heeIHpepvBvbLnwXfYlyjMVlLUTTsf+JoBtil8c8mO7tOeR1QqpM6HWYNdxMlornhFTC+IDltY3Iuf6SgSAg==
5+
- secure: xxO0PG/lrVC3pGyqHtQrz3mbPudfoko49OSE99UJ0NgKuPjfnEQygB1CDqV8KXlpjZemVeMwo2Feyw4lNnbDuPNPKsMGSNqPBtruWNKFfeOOcnMRvheWhE4/uvklrRcph+DBJhK4Kr3nZ9zldmyxXH2UdmYeoqsjhY8WVVOKJ91eFRjKDWtsuxBjPH1mTl6qAaBXl+JQapHB82AOfFKZ6fsUNoo2m3oa59ziKgctN/uwGKuY9Wyb1KcBCIi7/8Uax3v7GKSCJHZrCPfQLzXsFM10WvZgCn8caRHd04mBsw+diwwfKUt8JdfeDwRTi9C5kV0e04hcbIjnx6qeuU4w4g==
66
- GTEST_ROOT=$SHIPPABLE_BUILD_DIR/googletest-release-1.8.0/googletest
77

88
build:
@@ -32,8 +32,11 @@ build:
3232
- $GTEST_ROOT/build/sample10_unittest --gtest_output=xml:sample10.xml
3333
- gcovr --root ./ --filter ".*/samples/.*" --exclude ".*_unittest.*" -x -o coverage.xml
3434

35-
post_ci:
36-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
37-
- testspace build.log{issues} [Tests]sample*.xml coverage.xml $TESTSPACE_TOKEN/${BRANCH}#ship.Build.${BUILD_NUMBER}
35+
# Requires TESTSPACE_TOKEN environment variable.
36+
on_success:
37+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
38+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
3839

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

0 commit comments

Comments
 (0)