Fakultas Ilmu Komputer UI

Commit 828f7619 authored by Ichlasul Affan's avatar Ichlasul Affan
Browse files

Drop django-nose at the expense of logs are not being grouped for each tests.

parent 1b1a2cf3
......@@ -29,7 +29,7 @@ test-backend:
- pip install -r requirements.txt
- python3 manage.py makemigrations
- python3 manage.py migrate
- python3 manage.py test
- python3 manage.py test -v 2
artifacts:
paths:
- test/
......
nilai_mahasiswa = (3.4, 3.5, 3.6)
descending = "".join(sorted(str(nilai_mahasiswa), reverse = True))
print(descending)
\ No newline at end of file
# __init__.py
from core.tests.test_accounts import LoginTests, RegisterTests, ProfileUpdateTests
from core.tests.test_vacancies import ApplicationTests, BookmarkApplicationTests, CompanyListsTests, VacancyTest
from core.tests.test_create_vacancies import CreateAndUpdateVacancyTest
from core.tests.test_feedbacks import FeedbacksTests
......@@ -36,7 +36,6 @@ INSTALLED_APPS = [
'webpack_loader',
'core',
'rest_framework',
'django_nose',
'rest_framework_swagger',
'silk',
'django_filters'
......@@ -55,18 +54,10 @@ MIDDLEWARE = [
ROOT_URLCONF = 'kape.urls'
# Use nose to run all tests
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Tell nose to measure coverage on the 'foo' and 'bar' apps
NOSE_ARGS = [
'--with-coverage',
'--cover-package=core.views',
'--cover-html-dir=test/backend',
'--cover-html',
'--cover-xml',
'--cover-xml-file=test/backend/coverage.xml'
]
# Coverage parameters
TEST_COVER_PACKAGE = ['core']
TEST_COVERAGE_RESULT_HTML_DIR = 'test/backend'
TEST_COVERAGE_RESULT_XML = 'test/backend/coverage.xml'
TEMPLATES = [
{
......@@ -201,4 +192,4 @@ MAX_UPLOAD_SIZE = 5242880
API_MAHASISWA = "https://api.cs.ui.ac.id/siakngcs/mahasiswa/"
API_RIWAYAT_MAHASISWA = API_MAHASISWA+'{npm}/riwayat/'
API_VERIFY_USER = "https://akun.cs.ui.ac.id/oauth/token/verify/"
\ No newline at end of file
API_VERIFY_USER = "https://akun.cs.ui.ac.id/oauth/token/verify/"
......@@ -19,4 +19,32 @@ if __name__ == "__main__":
"forget to activate a virtual environment?"
)
raise
is_testing = 'test' in sys.argv and 'help' not in sys.argv
if is_testing:
import coverage
try:
from kape.settings import TEST_COVER_PACKAGE as sources
cov = coverage.coverage(source=sources, omit=['*/tests/*'])
except ImportError:
cov = coverage.coverage(omit=['*/tests/*'])
cov.erase()
cov.start()
execute_from_command_line(sys.argv)
if is_testing:
cov.stop()
cov.save()
cov.report()
try:
from kape.settings import TEST_COVERAGE_RESULT_HTML_DIR as html_dir
cov.html_report(directory=html_dir)
except ImportError:
pass
try:
from kape.settings import TEST_COVERAGE_RESULT_XML as xml_file
cov.xml_report(outfile=xml_file)
except ImportError:
pass
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