Skip to content

Commit 483a884

Browse files
committed
updates for new release
1 parent 193f80c commit 483a884

File tree

5 files changed

+53
-51
lines changed

5 files changed

+53
-51
lines changed

.c9build.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
22

3-
# Clean
43
# Clean
54
echo "removing files"
65
rm analysis-sniffer.xml
@@ -19,14 +18,10 @@ vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-
1918
# Test Code
2019
vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
2120

21+
# Download and configure the Testspace client
22+
mkdir -p $HOME/bin
23+
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
24+
CI=true testspace config url samples.testspace.com
2225

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-
31-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
32-
testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build
26+
# Push content (refer to ".testspace.txt" for list of content)
27+
testspace @.testspace.txt "#c9.Build" --repo git

.circle.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
machine:
22
php:
33
version: 5.5
4-
4+
5+
dependencies:
6+
pre:
7+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
8+
- testspace config url samples.testspace.com
9+
510
test:
611
override:
712
- composer install
813
- vendor/bin/phpcs src tests --report-gitblame=analysis-sniffer-blame.txt --report-checkstyle=analysis-sniffer.xml || true
914
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
1015
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
1116

12-
# Requires TESTSPACE_TOKEN environment variable.
17+
# refer to ".testspace.txt" for list of content
1318
post:
14-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
15-
- testspace @.testspace.txt $TESTSPACE_TOKEN/${CIRCLE_PROJECT_USERNAME}:${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}#circle.Build.${CIRCLE_BUILD_NUM}
19+
- testspace @.testspace.txt
20+

.travis.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ language:
44
php:
55
- 5.5
66

7+
before_script:
8+
- mkdir -p $HOME/bin
9+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
10+
- testspace config url samples.testspace.com
11+
- composer install
12+
713
script:
8-
- composer install
9-
- vendor/bin/phpcs src tests --report-gitblame=analysis-sniffer-blame.txt --report-checkstyle=analysis-sniffer.xml || true
10-
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
11-
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
14+
- vendor/bin/phpcs src tests --report-gitblame=analysis-sniffer-blame.txt --report-checkstyle=analysis-sniffer.xml || true
15+
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
16+
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
1217

13-
# Requires TESTSPACE_TOKEN environment variable.
18+
# refer to ".testspace.txt" for list of content
1419
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}
20+
- testspace @.testspace.txt

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
[![Testspace](http://www.testspace.com/img/Testspace.png)](http://www.testspace.com)
1+
[![Testspace](https://www.testspace.com/img/Testspace.png)](https://www.testspace.com)
22

33
***
44

55
## PHP/PHPUnit sample for demonstrating Testspace
66

77
Sample demonstrates techniques for using Testspace with PHP code and the [PHPUnit test framework](https://phpunit.de/).
88

9+
* Using a Testspace Project that is `connected` with this GitHub Repo
10+
* Using 3 Online CI services for demonstration purposes only
11+
* Can review the Results at [testspace-samples:php.phpunit](https://samples.testspace.com/projects/testspace-samples:php.phpunit)
12+
* Refer to our [Getting Started](https://help.testspace.com/getting-started) help articles for more information
13+
914
***
1015
Using Multiple Online CI Services:
1116

@@ -16,14 +21,20 @@ Using Multiple Online CI Services:
1621
***
1722
Publishing **Test Content** using www.testspace.com.
1823

19-
[![Space Health](https://samples.testspace.com/spaces/788/badge)](https://samples.testspace.com/spaces/788 "Test Cases")
20-
[![Space Metric](https://samples.testspace.com/spaces/788/metrics/727/badge)](https://samples.testspace.com/spaces/788/schema/Code%20Coverage "Code Coverage (methods)")
21-
[![Space Metric](https://samples.testspace.com/spaces/788/metrics/728/badge)](https://samples.testspace.com/spaces/788/schema/Code%20Coverage "Code Coverage (statements)")
22-
[![Space Metric](https://samples.testspace.com/spaces/788/metrics/729/badge)](https://samples.testspace.com/spaces/788/schema/Static%20Analysis "Static Analysis (issues)")
23-
24+
[![Space Health](https://samples.testspace.com/spaces/788/badge?token=a5b5d2ad4ec3d1e2eefc87cbe8c994342047dad4)](https://samples.testspace.com/spaces/788 "Test Cases")
25+
[![Space Metric](https://samples.testspace.com/spaces/788/metrics/728/badge?token=19e7e9c538ae12e6720cf1487ce7c67520613293)](https://samples.testspace.com/spaces/788/schema/Code%20Coverage "Code Coverage (statements)")
26+
[![Space Metric](https://samples.testspace.com/spaces/788/metrics/729/badge?token=615ea7773881334762ac85f47402bf4f559d67ed)](https://samples.testspace.com/spaces/788/schema/Static%20Analysis "Static Analysis (issues)")
2427

2528
***
2629

30+
Download and configure the Testspace client
31+
32+
<pre>
33+
mkdir -p $HOME/bin
34+
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
35+
testspace config url samples.testspace.com
36+
</pre>
37+
2738
In order to run this sample you will need a host workstation that supports the PHP.
2839

2940
Installation
@@ -45,19 +56,9 @@ vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover co
4556

4657
Pushing Content using **Testspace client**:
4758

59+
Push Content using Testspace client
60+
4861
<pre>
49-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
50-
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
62+
testspace @.testspace.txt
5163
</pre>
5264

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.
54-
55-
***
56-
57-
To replicate this sample:
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: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@ language:
44
php:
55
- 5.5
66

7-
env:
8-
global:
9-
- secure: ND2yONDKuoS6nW2BZqTnXSKqaXbaoO0ChmbAOhXIgOc79kxRalFEBajfT5hb9gMdVdZKaUwOif8MbHGYnKvvxMs1YKU8qG+GbIwQauAx29yHdKm/jV+BqHNDjYMhP6dIjldCg2Wn/g37NSYwFBFshePX5r6Q3UIppFw3MS06L0+Cfg4iOl1nccB8w+DxD4YhveS0wOiAWqZbMBaCr4SF01MQYUJP5D31pQBLLbI8ZuIE437kI+oFELLuFF7WEorYtPUnog7srlicGfOmwU+sIzpEcPR977TNnijtQ9RZ07AaqLdeiqF9cGYiSTVl5GkmbcfoWJPghuQv3dK3r2z1HA==
10-
117
build:
128
ci:
9+
- mkdir -p $HOME/bin
10+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
11+
- testspace config url samples.testspace.com
1312
- composer install
1413
- vendor/bin/phpcs src tests --report-gitblame=analysis-sniffer-blame.txt --report-checkstyle=analysis-sniffer.xml || true
1514
- vendor/bin/phpmd src,tests xml codesize,naming,unusedcode --reportfile analysis-mess.xml || true
1615
- vendor/bin/phpunit tests/unit --log-junit tests-results.xml --coverage-clover coverage.xml
17-
18-
# Requires TESTSPACE_TOKEN environment variable.
16+
17+
# refer to ".testspace.txt" for list of content
1918
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}
19+
- testspace @.testspace.txt
2220

2321
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}
22+
- testspace @.testspace.txt

0 commit comments

Comments
 (0)