Skip to content

Commit 1d0c8b1

Browse files
author
clowwindy
committed
add coverage
1 parent 9cfffa3 commit 1d0c8b1

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.jenkins.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@ rm -rf htmlcov
6060
rm -rf tmp
6161
coverage html --include=shadowsocks/*
6262

63+
coverage report --include=shadowsocks/* | tail -n1 | rev | cut -d' ' -f 1 | rev > /tmp/shadowsocks-coverage
64+
6365
exit $result

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
shadowsocks
22
===========
33

4-
[![PyPI version]][PyPI] [![Build Status]][Travis CI]
4+
[![PyPI version]][PyPI]
5+
[![Build Status]][Travis CI]
6+
[![Coverage Status]][Coverage]
57

68
A fast tunnel proxy that helps you bypass firewalls.
79

@@ -119,6 +121,8 @@ Bugs and Issues
119121
[Android]: https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients#android
120122
[Build Status]: https://img.shields.io/travis/clowwindy/shadowsocks/master.svg?style=flat
121123
[Chinese Readme]: https://github.com/clowwindy/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
124+
[Coverage Status]: http://192.81.132.184/result/shadowsocks
125+
[Coverage]: http://192.81.132.184/job/Shadowsocks/ws/htmlcov/index.html
122126
[Debian sid]: https://packages.debian.org/unstable/python/shadowsocks
123127
[the package]: https://pypi.python.org/pypi/shadowsocks
124128
[Encryption]: https://github.com/clowwindy/shadowsocks/wiki/Encryption

tests/coverage_server.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python
2+
3+
import tornado.ioloop
4+
import tornado.web
5+
import urllib
6+
7+
8+
class MainHandler(tornado.web.RequestHandler):
9+
def get(self):
10+
with open('/tmp/shadowsocks-coverage', 'rb') as f:
11+
coverage = f.read().strip()
12+
self.redirect(('https://img.shields.io/badge/'
13+
'coverage-%s-brightgreen.svg'
14+
'?style=flat') %
15+
urllib.quote(coverage))
16+
17+
application = tornado.web.Application([
18+
(r"/shadowsocks", MainHandler),
19+
])
20+
21+
if __name__ == "__main__":
22+
application.listen(8888, address='127.0.0.1')
23+
tornado.ioloop.IOLoop.instance().start()

0 commit comments

Comments
 (0)