-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Port integration tests to py3, and run them in the same docker container as the rust server. Fix #911
- Loading branch information
Showing
11 changed files
with
3,093 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[server:main] | ||
use = egg:Paste#http | ||
host = 0.0.0.0 | ||
port = 5000 | ||
|
||
[app:main] | ||
use = egg:SyncStorage | ||
|
||
[storage] | ||
backend = syncstorage.storage.sql.SQLStorage | ||
sqluri = ${MOZSVC_SQLURI} | ||
standard_collections = true | ||
quota_size = 5242880 | ||
pool_size = 100 | ||
pool_recycle = 3600 | ||
reset_on_return = true | ||
create_tables = true | ||
max_post_records = 4000 | ||
batch_upload_enabled = true | ||
force_consistent_sort_order = true | ||
|
||
[hawkauth] | ||
secret = "TED KOPPEL IS A ROBOT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
hawkauthlib | ||
konfig | ||
pyramid | ||
pyramid_hawkauth | ||
requests | ||
simplejson | ||
tokenlib | ||
unittest2 | ||
webtest | ||
wsgiproxy2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import atexit | ||
import os.path | ||
import subprocess | ||
import sys | ||
from test_storage import TestStorage | ||
from test_support import run_live_functional_tests | ||
import time | ||
|
||
|
||
DEBUG_BUILD = 'target/debug/syncstorage' | ||
RELEASE_BUILD = '/app/bin/syncstorage' | ||
|
||
if __name__ == "__main__": | ||
# When run as a script, this file will execute the | ||
# functional tests against a live webserver. | ||
target_binary = None | ||
if os.path.exists(DEBUG_BUILD): | ||
target_binary = DEBUG_BUILD | ||
elif os.path.exists(RELEASE_BUILD): | ||
target_binary = RELEASE_BUILD | ||
else: | ||
raise RuntimeError("Neither target/debug/syncstorage nor /app/bin/syncstorage were found.") | ||
the_server_subprocess = subprocess.Popen('SYNC_MASTER_SECRET=secret0 ' + target_binary, shell=True) | ||
## TODO we should change this to watch for a log message on startup to know when to continue instead of sleeping for a fixed amount | ||
time.sleep(20) | ||
|
||
def stop_subprocess(): | ||
the_server_subprocess.terminate() | ||
the_server_subprocess.wait() | ||
|
||
atexit.register(stop_subprocess) | ||
|
||
res = run_live_functional_tests(TestStorage, sys.argv) | ||
sys.exit(res) |
Oops, something went wrong.