Skip to content

Commit 213ba2c

Browse files
committed
updates based on new release
1 parent 0804db0 commit 213ba2c

File tree

6 files changed

+43
-52
lines changed

6 files changed

+43
-52
lines changed

.c9build.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ pylint stock_alerter/ -f parseable > analysis.txt
1010
# Test with Code Coverage
1111
nose2 --junit-xml --with-coverage
1212

13-
# Publish
13+
# Download and configure the Testspace client
14+
mkdir -p $HOME/bin
15+
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
16+
CI=true testspace config url samples.testspace.com
1417

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-
21-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
22-
testspace @.testspace.txt $TESTSPACE_TOKEN/${REPO_SLUG/\//:}/${BRANCH_NAME}#c9.Build
18+
# Push content (refer to ".testspace.txt" for list of content)
19+
testspace analysis.txt{lint} nose2.xml{stock_alerter} coverage.xml "#c9.Build" --repo git

.testspace.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ python:
55
- "2.7.6"
66

77
before_script:
8+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
9+
- testspace config url samples.testspace.com
810
- sudo pip install -r requirements.txt
911
- sudo apt-get install pylint
10-
12+
1113
script:
1214
- pylint stock_alerter/ -f parseable > analysis.txt || true
1315
- nose2 --junit-xml --with-coverage
1416

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

README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,46 @@
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
## Python/Unittest sample for demonstrating Testspace based on the [test_driven_python repo](https://github.com/siddhi/test_driven_python)
66

77
Sample demonstrates techniques for using Testspace with Python code and the [`unittest` test framework](https://docs.python.org/2/library/unittest.html) together with [`cov-core` code coverage tool](https://pypi.python.org/pypi/cov-core) and [`nose2` runner](https://github.com/nose-devs/nose2).
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:python.unittest](https://samples.testspace.com/projects/testspace-samples:python.unittest)
12+
* Refer to our [Getting Started](https://help.testspace.com/getting-started) help articles for more information
13+
14+
915
***
1016
Using Multiple Online CI Services:
1117

12-
[![Build Status](https://travis-ci.org/testspace-samples/php.phpunit.svg?branch=master)](https://travis-ci.org/testspace-samples/php.phpunit)
18+
[![Build Status](https://travis-ci.org/testspace-samples/php.phpunit.svg?branch=master)](https://travis-ci.org/testspace-samples/python.unittest)
1319
[![CircleCI](https://circleci.com/gh/testspace-samples/python.unittest.svg?style=svg)](https://circleci.com/gh/testspace-samples/python.unittest)
14-
[![Run Status](https://api.shippable.com/projects/5710a3e02a8192902e1c1f8d/badge?branch=master)](https://app.shippable.com/projects/5710a3e02a8192902e1c1f8d)
20+
[![Run Status](https://api.shippable.com/projects/5710a3e02a8192902e1c1f8d/badge?branch=master)](https://app.shippable.com/github/testspace-samples/python.unittest)
1521

1622

1723
***
1824
Publishing **Test Content** using www.testspace.com.
1925

20-
[![Space Health](https://samples.testspace.com/spaces/757/badge)](https://samples.testspace.com/spaces/757 "Test Cases")
21-
[![Space Metric](https://samples.testspace.com/spaces/757/metrics/683/badge)](https://samples.testspace.com/spaces/757/schema/Code%20Coverage "Code Coverage (lines)")
22-
[![Space Metric](https://samples.testspace.com/spaces/757/metrics/684/badge)](https://samples.testspace.com/spaces/757/schema/Static%20Analysis "Static Analysis (issues)")
26+
[![Space Health](https://samples.testspace.com/spaces/759/badge?token=2b415e73ed35943961c25a0d451ed41da64b029e)](https://samples.testspace.com/spaces/759 "Test Cases")
27+
[![Space Metric](https://samples.testspace.com/spaces/759/metrics/685/badge?token=b4e77a71c198ade1720e3452e1ba684c59d70dde)](https://samples.testspace.com/spaces/759/schema/Code%20Coverage "Code Coverage (lines)")
28+
[![Space Metric](https://samples.testspace.com/spaces/759/metrics/686/badge?token=ed591f894dacb99be130ff1f0a71e7b5a5c58e65)](https://samples.testspace.com/spaces/759/schema/Static%20Analysis "Static Analysis (issues)")
2329

2430
***
2531

2632
In order to run this sample you will need a host workstation with installed python 2.6+.
2733

28-
Buiding:
2934

35+
Download and configure the Testspace client
36+
<pre>
37+
mkdir -p $HOME/bin
38+
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
39+
testspace config url samples.testspace.com
40+
</pre>
41+
42+
43+
Buiding:
3044
<pre>
3145
sudo pip install -r requirements.txt
3246
sudo apt-get install pylint
@@ -44,21 +58,9 @@ Running Tests with Code Coverage:
4458
nose2 --junit-xml --with-coverage
4559
</pre>
4660

47-
48-
Push Content using **Testspace client**:
61+
Push Content using Testspace client
4962

5063
<pre>
51-
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
52-
testspace @.testspace.txt $TESTSPACE_TOKEN/$GITHUB_ORG:$REPO_NAME/$BRANCH_NAME#$BUILD_NUMBER
64+
testspace analysis.txt{lint} nose2.xml{stock_alerter} coverage.xml
5365
</pre>
5466

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.
56-
57-
***
58-
59-
To replicate this sample:
60-
- Setup account at www.testspace.com.
61-
- Create a Environment variable called `TESTSPACE_TOKEN`
62-
- `TESTSPACE_TOKEN` = `[email protected]`
63-
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials)
64-
- 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

circle.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ machine:
44

55
dependencies:
66
override:
7+
- curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
8+
- testspace config url samples.testspace.com
79
- sudo pip install -r requirements.txt
810
- sudo apt-get install pylint
9-
11+
1012
test:
1113
override:
1214
- pylint stock_alerter/ -f parseable > analysis.txt || true
1315
- nose2 --junit-xml --with-coverage
1416

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

shippable.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@ language: python
33
python:
44
- "2.7.6"
55

6-
env:
7-
global:
8-
- secure: fmnjo4w31dWiBiCE52YfvBN+OGcIopLy1QeCF9swK/ZoIVNE8VmSV6q2Od7xSBwjXFHdTp5CII5uwjkRUey/Sq4CoCIGmpxOUkopfWdi+U/x84uAt53bgpx8dTIwe/5P+B28XOHSClUv1ZD5QaU8hw/daAZZ8RhsqXdH4orSm5fjL69apFfBdVVY4h7UHTczKIe+gxJGV8hom7XArUUmpNxsoztdDZlgAtYFv1D2QJu5OiNt0QB6fqvBdjzr2Bziqbzn//ldf6KCapEBgfmdFyqfNy0iHr7nBcQDjr/SgsxJYaLgbwWAFB7ANfsgSzNt0qha59VqD9MJ4iIjciNF2A==
9-
106
build:
117
ci:
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
1211
- sudo pip install -r requirements.txt
1312
- sudo apt-get install pylint
1413
- pylint stock_alerter/ -f parseable > analysis.txt || true
1514
- nose2 --junit-xml --with-coverage
1615

17-
# Requires TESTSPACE_TOKEN environment variable.
1816
on_success:
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}
21-
17+
- testspace analysis.txt{lint} nose2.xml{stock_alerter} coverage.xml
18+
2219
on_failure:
23-
- curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | sudo tar -zxvf- -C /usr/local/bin
24-
- testspace @.testspace.txt $TESTSPACE_TOKEN/${SHIPPABLE_REPO_SLUG/\//:}/${BRANCH}#ship.Build.${BUILD_NUMBER}
20+
- testspace analysis.txt{lint} nose2.xml{stock_alerter} coverage.xml

0 commit comments

Comments
 (0)