Commit 74b05541 authored by Bruce Flynn's avatar Bruce Flynn

use docker for test db

parent 19e45f81
Pipeline #1344 failed with stage
in 40 seconds
version: "2"
services:
http:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./data:/usr/share/nginx/html:ro
ports:
- 8080:80
db:
environment:
- POSTGRES_USER=docker
- POSTGRES_DB=docker
image: postgres:9.6
ports:
- 5432:5432
volumes:
- ./test_db_init.sh:/docker-entrypoint-initdb.d/test_db_init.sh
worker_processes 1;
events {
worker_connections 1024;
}
http {
sendfile on;
server {
listen 80;
location / {
root /usr/share/nginx/html/;
index index.html;
autoindex on;
}
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ from datetime import datetime
import numpy as np
import pytest
from webtest import TestApp
from webtest import TestApp as _TestApp
from amrc_aws import app
......@@ -54,7 +54,7 @@ def mock_database(monkeypatch):
@pytest.fixture
def pyramid_app(mock_database):
return TestApp(app.main({}))
return _TestApp(app.main({}))
class Test(object):
......
#!/usr/bin/env bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<EOSQL
CREATE DATABASE __test;
GRANT ALL PRIVILEGES ON DATABASE __test TO docker;
EOSQL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment