Attempt to export acceptance tests coverage results to coveralls

This commit is contained in:
Alexander Kukushkin
2016-03-13 09:09:31 +01:00
parent 6985df3aca
commit 62f11ab747
4 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -3,9 +3,10 @@ Feature: basic replication
Scenario: check replication of a single table
Given I start postgres0
And postgres0 is a leader after 10 seconds
And I start postgres1
When I add the table foo to postgres0
Then table foo is present on postgres1 after 10 seconds
Then table foo is present on postgres1 after 15 seconds
Scenario: check the basic failover
When I kill postgres0
+1
View File
@@ -3,6 +3,7 @@ Feature: cascading replication
Scenario: check a base backup from the replica
Given I start postgres0
And postgres0 is a leader after 10 seconds
And I start postgres1
And replication works from postgres0 to postgres1 after 15 seconds
And I create label with "postgres0" in postgres0 data directory
+4 -1
View File
@@ -59,7 +59,7 @@ class PatroniController(object):
self._config[pg_name] = self._make_patroni_test_config(pg_name, tags=tags)
p = subprocess.Popen(['python', 'patroni.py', self._config[pg_name]],
p = subprocess.Popen(['coverage', 'run', '--branch', '--source=patroni', '-p', 'patroni.py', self._config[pg_name]],
stdout=self._log[pg_name], stderr=subprocess.STDOUT, cwd=cwd)
if not (p and p.pid and p.poll() is None):
assert False, "PostgreSQL {0} is not running after being started".format(pg_name)
@@ -190,6 +190,7 @@ class PatroniController(object):
class EtcdController(object):
""" handles all etcd related tasks, used for the tests setup and cleanup """
ETCD_VERSION_URL = 'http://127.0.0.1:2379/version'
ETCD_CLEANUP_URL = 'http://127.0.0.1:2379/v2/keys/service/batman?recursive=true'
@@ -300,3 +301,5 @@ def after_feature(context, feature):
context.pctl.stop_all()
shutil.rmtree(os.path.join(context.pctl.patroni_path, 'data'))
context.etcd_ctl.cleanup_service_tree()
subprocess.call(['coverage', 'combine'])
subprocess.call(['coverage', 'report'])