Skip to content

Commit 06dbf1e

Browse files
committed
update token standard
1 parent 1bc3fe5 commit 06dbf1e

File tree

6 files changed

+42
-27
lines changed

6 files changed

+42
-27
lines changed

.c9build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-
1919
# Test Code
2020
vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
2121

22-
# Publish Test Content
22+
23+
# Publish
24+
25+
## Requires TESTSPACE_TOKEN = $ACCESS_TOKEN:@samples.testspace.com.
26+
27+
BRANCH_NAME=`git symbolic-ref --short HEAD`
28+
GIT_URL=`git remote show origin -n | grep Fetch\ URL: | sed 's/.*URL: //'`
29+
REPO_SLUG=`echo ${GIT_URL#*github.com?} | sed 's/.git//'`
30+
2331
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
24-
testspace publish @.testspace master.c9
32+
testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build

.circle.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ test:
88
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
99
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
1010

11-
post:
12-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
13-
- testspace publish @.testspace $TESTSPACE_TOKEN/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
11+
# Requires TESTSPACE_TOKEN environment variable.
12+
post:
13+
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
14+
- testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
File renamed without changes.

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ script:
1010
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
1111
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
1212

13-
after_script:
14-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
15-
- testspace publish @.testspace $TESTSPACE_TOKEN/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}
13+
# Requires TESTSPACE_TOKEN environment variable.
14+
after_script:
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/${TRAVIS_REPO_SLUG/\//:}/${TRAVIS_BRANCH}#travis.Build.${TRAVIS_BUILD_NUMBER}

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
## PHP/PHPUnit sample for demonstrating Testspace
@@ -15,10 +16,10 @@ Using Multiple Online CI Services:
1516
***
1617
Publishing **Test Content** using www.testspace.com.
1718

18-
[![Space Health](https://samples.testspace.com/projects/119/spaces/441/badge)](https://samples.testspace.com/projects/119/spaces/441 "Test Cases")
19-
[![Space Metric](https://samples.testspace.com/projects/119/spaces/441/metrics/267/badge)](https://samples.testspace.com/spaces/441/schema/Code%20Coverage "Code Coverage (statements)")
20-
[![Space Metric](https://samples.testspace.com/projects/119/spaces/441/metrics/266/badge)](https://samples.testspace.com/spaces/441/schema/Code%20Coverage "Code Coverage (methods)")
21-
[![Space Metric](https://samples.testspace.com/projects/119/spaces/441/metrics/268/badge)](https://samples.testspace.com/spaces/441/schema/Static%20Analysis "Static Analysis (issues)")
19+
[![Space Health](https://samples.testspace.com/projects/163/spaces/788/badge)](https://samples.testspace.com/projects/163/spaces/788 "Test Cases")
20+
[![Space Metric](https://samples.testspace.com/projects/163/spaces/788/metrics/727/badge)](https://samples.testspace.com/spaces/788/schema/Code%20Coverage "Code Coverage (methods)")
21+
[![Space Metric](https://samples.testspace.com/projects/163/spaces/788/metrics/728/badge)](https://samples.testspace.com/spaces/788/schema/Code%20Coverage "Code Coverage (statements)")
22+
[![Space Metric](https://samples.testspace.com/projects/163/spaces/788/metrics/729/badge)](https://samples.testspace.com/spaces/788/schema/Static%20Analysis "Static Analysis (issues)")
2223

2324

2425
***
@@ -42,21 +43,21 @@ Running Tests with Code Coverage
4243
vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
4344
</pre>
4445

45-
Publishing Results using **Testspace**: (note, `.testspace` contains files to publish)
46+
Pushing Content using **Testspace client**:
4647

4748
<pre>
4849
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
49-
testspace @.testspace $TESTSPACE_TOKEN/$BRANCH_NAME
50+
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
5051
</pre>
5152

52-
53-
Checkout the [Space](https://samples.testspace.com/projects/php.phpunit).
53+
Checkout the published [Test Content](https://samples.testspace.com/projects/testspace-samples:php.phpunit). 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.
5454

5555
***
5656

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

shippable.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@ php:
66

77
env:
88
global:
9-
- secure: Ug5KuSwbLk2AF5dkSrGZ30VMsKR/UqugSc8y3IJtt1zARJYwNKgRU+e+2MCPBi78P9qZqEnwiK9zNzMpTBO/u8Bbs9/xG/4f0ixPFpyR8KUj8Mb6Kxr38Kr6qu1Wf/JHPW5+jR2sr5Sw2rfjyYACSOGoBExa33hwRoZtqPytghYYafoE+GNjSniwKm7Izub2HDd6zliErsOzcshlH+f76TrqPIqlSYmgDA/5PrPBP3I7QOJ8a5Y8QVQ8RNjI020QpUFqDzi7G/nZ/SmyIcr0oFQYGHmpV0+u196DjWfU/GdY5kygDsbxOgUcLoeWNkLXbTBmOtc2+dgEMj29uFy7Mg==
10-
9+
- secure: ND2yONDKuoS6nW2BZqTnXSKqaXbaoO0ChmbAOhXIgOc79kxRalFEBajfT5hb9gMdVdZKaUwOif8MbHGYnKvvxMs1YKU8qG+GbIwQauAx29yHdKm/jV+BqHNDjYMhP6dIjldCg2Wn/g37NSYwFBFshePX5r6Q3UIppFw3MS06L0+Cfg4iOl1nccB8w+DxD4YhveS0wOiAWqZbMBaCr4SF01MQYUJP5D31pQBLLbI8ZuIE437kI+oFELLuFF7WEorYtPUnog7srlicGfOmwU+sIzpEcPR977TNnijtQ9RZ07AaqLdeiqF9cGYiSTVl5GkmbcfoWJPghuQv3dK3r2z1HA==
10+
1111
build:
1212
ci:
1313
- composer install
1414
- vendor/bin/phpcs src tests --report-gitblame=analysis-sniffer-blame.txt --report-checkstyle=analysis-sniffer.xml || true
1515
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
1616
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
1717

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

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

0 commit comments

Comments
 (0)