Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-notes-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-notes-api
Commits
1dc3ca50
Commit
1dc3ca50
authored
Feb 01, 2017
by
Fred Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dockerize tests
parent
d769550d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
25 deletions
+91
-25
.gitignore
+3
-0
.travis.yml
+14
-15
.travis/docker-compose-travis.yml
+40
-0
.travis/docker.mk
+16
-0
.travis/run_tests.sh
+7
-0
Makefile
+3
-7
notesserver/settings/test.py
+8
-3
No files found.
.gitignore
View file @
1dc3ca50
...
...
@@ -8,3 +8,6 @@ coverage/
# Sqlite Database
*.db
#vim
*.swp
.travis.yml
View file @
1dc3ca50
language
:
python
python
:
2.7
sudo
:
false
install
:
-
scripts/travis/install.sh
-
scripts/travis/setup.sh
-
pip install -r requirements/test.txt
-
git fetch origin master:refs/remotes/origin/master
# https://github.com/edx/diff-cover#troubleshooting
-
pip install coveralls
python
:
-
"
3.5"
services
:
-
docker
sudo
:
required
before_install
:
-
make travis_up
script
:
-
make
validate
-
make
travis_test
after_success
:
-
coveralls
env
:
-
ESVER=-
-
ESVER=0.90.11
-
ESVER=1.4.2
-
pip install -U codecov
-
docker exec notes /edx/app/notes/notes/.travis/run_coverage.sh
-
codecov
.travis/docker-compose-travis.yml
0 → 100644
View file @
1dc3ca50
version
:
"
2"
services
:
db
:
image
:
mysql:5.6
container_name
:
db
command
:
mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
environment
:
MYSQL_ROOT_PASSWORD
:
"
"
MYSQL_ALLOW_EMPTY_PASSWORD
:
"
yes"
MYSQL_USER
:
"
notes001"
MYSQL_PASSWORD
:
"
secret"
MYSQL_DATABASE
:
"
edx_notes_api"
es
:
image
:
edxops/elasticsearch:0.9.13
container_name
:
es
notes
:
# Uncomment this line to use the official course-discovery base image
image
:
edxops/notes:latest
# Uncomment the next two lines to build from a local configuration repo
# build: ../configuration/docker/build/discovery/
container_name
:
edx_notes_api
volumes
:
-
..:/edx/app/edx_notes_api/edx_notes_api
command
:
tail -f /dev/null
depends_on
:
-
"
db"
-
"
es"
environment
:
CONN_MAX_AGE
:
60
DB_ENGINE
:
"
django.db.backends.mysql"
DB_HOST
:
"
db"
DB_NAME
:
"
edx_notes_api"
DB_PASSWORD
:
"
secret"
DB_PORT
:
"
3306"
DB_USER
:
"
notes001"
ENABLE_DJANGO_TOOLBAR
:
1
ELASTICSEARCH_URL
:
"
http://es:9200"
.travis/docker.mk
0 → 100644
View file @
1dc3ca50
.PHONY
:
travis_down travis_start travis_stop travis_test travis_up
travis_up
:
##
Create containers used to run tests on Travis CI
docker-compose
-f
.travis/docker-compose-travis.yml up
-d
travis_start
:
##
Start containers stopped by `travis_stop`
docker-compose
-f
.travis/docker-compose-travis.yml start
travis_test
:
##
Run tests on Docker containers
,
as on Travis CI
docker
exec
-it
edx_notes_api env
TERM
=
$(TERM)
/edx/app/edx_notes_api/edx_notes_api/.travis/run_tests.sh
travis_stop
:
##
Stop running containers created by `travis_up` without removing them
docker-compose
-f
.travis/docker-compose-travis.yml stop
travis_down
:
##
Stop and remove containers and other resources created by `travis_up`
docker-compose
-f
.travis/docker-compose-travis.yml down
.travis/run_tests.sh
0 → 100755
View file @
1dc3ca50
#!/bin/bash -xe
.
/edx/app/edx_notes_api/venvs/edx_notes_api/bin/activate
cd
/edx/app/edx_notes_api/edx_notes_api
make validate
Makefile
View file @
1dc3ca50
PACKAGES
=
notesserver notesapi
.PHONY
:
requirements
validate
:
test.requirements test coverage
include
.travis/docker.mk
ifeq
($(ESVER),-)
test_settings
=
notesserver.settings.test_es_disabled
else
test_settings
=
notesserver.settings.test
endif
validate
:
test.requirements test
test
:
clean
./manage.py
test
--settings
=
$(test_settings)
--with-coverage
--with-ignore-docstrings
\
./manage.py
test
--settings
=
notesserver.settings.test
--with-coverage
--with-ignore-docstrings
\
--exclude-dir
=
notesserver/settings
--cover-inclusive
--cover-branches
\
--cover-html
--cover-html-dir
=
build/coverage/html/
\
--cover-xml
--cover-xml-file
=
build/coverage/coverage.xml
--verbosity
=
2
\
...
...
notesserver/settings/test.py
View file @
1dc3ca50
...
...
@@ -2,8 +2,13 @@ from .common import *
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
'default.db'
,
'ENGINE'
:
os
.
environ
.
get
(
'DB_ENGINE'
,
'django.db.backends.sqlite3'
),
'NAME'
:
os
.
environ
.
get
(
'DB_NAME'
,
'default.db'
),
'USER'
:
os
.
environ
.
get
(
'DB_USER'
,
''
),
'PASSWORD'
:
os
.
environ
.
get
(
'DB_PASSWORD'
,
''
),
'HOST'
:
os
.
environ
.
get
(
'DB_HOST'
,
''
),
'PORT'
:
os
.
environ
.
get
(
'DB_PORT'
,
''
),
'CONN_MAX_AGE'
:
int
(
os
.
environ
.
get
(
'CONN_MAX_AGE'
,
0
))
}
}
...
...
@@ -14,7 +19,7 @@ INSTALLED_APPS += ('django_nose',)
HAYSTACK_CONNECTIONS
=
{
'default'
:
{
'ENGINE'
:
'notesserver.highlight.ElasticsearchSearchEngine'
,
'URL'
:
'http://127.0.0.1:9200/'
,
'URL'
:
os
.
environ
.
get
(
'ELASTICSEARCH_URL'
,
'http://localhost:9200/'
)
,
'INDEX_NAME'
:
'notes_index_test'
,
},
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment