-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update integration tests workflow and add pytest configurat…
…ion (#221) * refactor(ci): update workflow, script, and tests to use latest action version for integration tests * fix: pytest path * fix: install-dev-dependencies target * fix: test-python target * fix: remove self from backend test * chore: add pytest and pytest-django to test requirements add pylint constraint * fix: remove fixtures file * fix: integration tests * fix: include settings file for python unit tests * fix: typo * fix: install dev dependencies * fix: quality * fix: app name * fix: use branch with optional extra requirements * chore(ci): remove integration tests for nightly * fix: quality * fix: set default config file for Pytest * fix: add EOX_TENANT_BASE_URL setting * feat: add type hint to setup class * fix: run integration tests in nightly * fix: upgrade requirements with py3.8 * fix: undo change in coverage configs * fix: run isort for backend tests * refactor: create makefile target to execute integration tests * fix: integration tests target * fix: integration tests target in makefile * fix: improve info view test * chore(ci): use main branch from integration tests action and remove unnecessary input
- Loading branch information
Showing
21 changed files
with
166 additions
and
157 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
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
File renamed without changes.
Empty file.
18 changes: 18 additions & 0 deletions
18
eox_tenant/edxapp_wrapper/tests/integration/test_backends.py
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,18 @@ | ||
""" | ||
This module tests the backends of the edxapp_wrapper | ||
""" | ||
|
||
|
||
# pylint: disable=import-outside-toplevel,unused-import | ||
def test_current_settings_code_imports(): | ||
""" | ||
Running this imports means that our backends import the right signature | ||
""" | ||
import eox_tenant.edxapp_wrapper.backends.bearer_authentication_l_v1 | ||
import eox_tenant.edxapp_wrapper.backends.branding_api_l_v1 | ||
import eox_tenant.edxapp_wrapper.backends.edx_auth_n_v1 | ||
import eox_tenant.edxapp_wrapper.backends.edxmako_l_v1 | ||
import eox_tenant.edxapp_wrapper.backends.oauth_dispatch_j_v1 | ||
import eox_tenant.edxapp_wrapper.backends.site_configuration_module_i_v1 | ||
import eox_tenant.edxapp_wrapper.backends.theming_helpers_h_v1 | ||
import eox_tenant.edxapp_wrapper.backends.users_p_v1 |
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
Empty file.
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,33 @@ | ||
""" | ||
Test integration file. | ||
""" | ||
import requests | ||
from django.conf import settings as ds | ||
from django.test import TestCase | ||
from django.urls import reverse | ||
from rest_framework import status | ||
|
||
settings = ds.INTEGRATION_TEST_SETTINGS | ||
|
||
|
||
class TestInfoView(TestCase): | ||
""" | ||
Integration test suite for the info view. | ||
""" | ||
|
||
def test_info_view_success(self) -> None: | ||
"""Test the info view. | ||
Expected result: | ||
- The status code is 200. | ||
- The response contains the version, name and git commit hash. | ||
""" | ||
url = f"{settings['EOX_TENANT_BASE_URL']}{reverse('eox-info')}" | ||
|
||
response = requests.get(url, timeout=settings["API_TIMEOUT"]) | ||
|
||
response_data = response.json() | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertIn("version", response_data) | ||
self.assertIn("name", response_data) | ||
self.assertIn("git", response_data) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
django==4.2.13 | ||
django==4.2.16 |
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
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 |
---|---|---|
|
@@ -5,6 +5,8 @@ django-fake-model | |
ddt | ||
pycodestyle | ||
pylint | ||
pytest | ||
pytest-django | ||
coverage | ||
mock | ||
testfixtures | ||
|
Oops, something went wrong.