Skip to content

Commit

Permalink
Add a run-tests-locally script, like we have for the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Oct 22, 2015
1 parent 4a3f3f3 commit 1f477d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fts/test_dataload.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_googledoc_input(browser, google_doc_dataset):
def test_push(browser, google_doc_dataset, process_id, other_process_id):
browser.find_element_by_css_selector("button.btn.btn-default.{}".format(process_id)).click()
# Check if it's in
url = 'http://localhost:8890/sparql?default-graph-uri=&query=select+%3Fs+WHERE+%7B+%3Fs+a+%3Chttp%3A%2F%2Fresourceprojects.org%2Fdef%2FProject%3E+%7D&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'
url = os.environ.get('SPARQL_ENDPOINT', 'http://localhost:8890/sparql') + '?default-graph-uri=&query=select+%3Fs+WHERE+%7B+%3Fs+a+%3Chttp%3A%2F%2Fresourceprojects.org%2Fdef%2FProject%3E+%7D&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'
assert 'resourceprojects.org' in requests.get(url, headers={'Host': process_id}).text
if other_process_id != 'staging':
assert 'resourceprojects.org' not in requests.get(url, headers={'Host': other_process_id}).text
Expand Down
10 changes: 10 additions & 0 deletions run-tests-locally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
docker build -t opendataservices/resource-projects-etl .
docker rm -f virtuoso-etl-test || true
docker rm -f etl-test || true
docker run -d -p 127.0.0.1:8886:8890 --name virtuoso-etl-test opendataservices/virtuoso:master
sleep 30s
cat virtuoso_setup.sql | docker run --link virtuoso-etl-test:virtuoso -i --rm opendataservices/virtuoso:master isql virtuoso
docker run -d --publish=127.0.0.86:80:80 --link virtuoso-etl-test:virtuoso -e DBA_PASS=dba --name etl-test opendataservices/resource-projects-etl
SERVER_URL=http://127.0.0.86/ SPARQL_ENDPOINT=http://localhost:8886/sparql py.test fts

0 comments on commit 1f477d4

Please sign in to comment.