forked from wallabag/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis builds and spins up containers for sqlite, mariadb and postgres and runs a simple python test script for accessing the wallabag.
- Loading branch information
1 parent
107beb1
commit 4a81bc4
Showing
6 changed files
with
105 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.cache | ||
__pycache__/* | ||
*.pyc |
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,25 @@ | ||
language: python | ||
|
||
python: | ||
- 3.5 | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
- DB_TYPE=sqlite | ||
- DB_TYPE=mariadb | ||
- DB_TYPE=postgresql | ||
|
||
install: | ||
- docker-compose -f tests/docker-compose.$DB_TYPE.yml build | ||
- docker-compose -f tests/docker-compose.$DB_TYPE.yml up -d | ||
|
||
before_script: | ||
- pip install pytest | ||
- pip install requests | ||
|
||
script: | ||
- docker ps | grep -q wallabag | ||
- sleep 60 | ||
- py.test tests/ |
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,22 @@ | ||
version: '2' | ||
services: | ||
wallabag: | ||
build: | ||
context: ../ | ||
image: wallabag:mariadb | ||
container_name: wallabag | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=wallaroot | ||
- SYMFONY__ENV__SECRET=F00B4R | ||
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql | ||
- SYMFONY__ENV__DATABASE_HOST=db | ||
- SYMFONY__ENV__DATABASE_PORT=3306 | ||
- SYMFONY__ENV__DATABASE_NAME=wallabag | ||
- SYMFONY__ENV__DATABASE_USER=wallabag | ||
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass | ||
ports: | ||
- "127.0.0.1:80:80" | ||
db: | ||
image: mariadb | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=wallaroot |
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,24 @@ | ||
version: '2' | ||
services: | ||
wallabag: | ||
build: | ||
context: ../ | ||
image: wallabag:postgresql | ||
container_name: wallabag | ||
environment: | ||
- POSTGRES_PASSWORD=my-secret-pw | ||
- POSTGRES_USER=my-super-user | ||
- SYMFONY__ENV__SECRET=F00B4R | ||
- SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql | ||
- SYMFONY__ENV__DATABASE_HOST=db | ||
- SYMFONY__ENV__DATABASE_PORT=5432 | ||
- SYMFONY__ENV__DATABASE_NAME=wallabag | ||
- SYMFONY__ENV__DATABASE_USER=wallabag | ||
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass | ||
ports: | ||
- "127.0.0.1:80:80" | ||
db: | ||
image: postgres | ||
environment: | ||
- POSTGRES_PASSWORD=my-secret-pw | ||
- POSTGRES_USER=my-super-user |
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,17 @@ | ||
version: '2' | ||
services: | ||
wallabag: | ||
build: | ||
context: ../ | ||
image: wallabag:sqlite | ||
container_name: wallabag | ||
environment: | ||
- SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite | ||
- SYMFONY__ENV__DATABASE_HOST=127.0.0.1 | ||
- SYMFONY__ENV__DATABASE_PORT=~ | ||
- SYMFONY__ENV__DATABASE_NAME=symfony | ||
- SYMFONY__ENV__DATABASE_USER=root | ||
- SYMFONY__ENV_DATABASE_PASSWORD=~ | ||
- SYMFONY__ENV__SECRET=F00B4R | ||
ports: | ||
- "127.0.0.1:80:80" |
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,14 @@ | ||
import requests | ||
|
||
|
||
URL = 'http://127.0.0.1:80' | ||
|
||
|
||
def test_login_page(): | ||
r = requests.get(URL, allow_redirects=True) | ||
|
||
assert r.status_code == 200 | ||
assert 'Login' in r.text | ||
assert 'Password' in r.text | ||
assert 'Register' in r.text | ||
assert 'Username' in r.text |