From 56d928a15a77589b03963e74ac0e527f8e01f28b Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Mon, 15 Jul 2024 08:54:31 +0100 Subject: [PATCH 01/11] test(exclude-coverage): excludes callback function from coverage --- backend/login/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/login/views.py b/backend/login/views.py index bb75c9d2..321af752 100644 --- a/backend/login/views.py +++ b/backend/login/views.py @@ -38,7 +38,7 @@ def get(self, request, format=None): class callback(APIView): - def get(self, request, format=None): + def get(self, request, format=None): # pragma: no cover """Callback method redirected from osm callback method Args: From 8721fd8fb3fd5b51ec9aba4263f9589b0ef2a29e Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Mon, 15 Jul 2024 08:59:44 +0100 Subject: [PATCH 02/11] test(model-factories): adds model factories to isolate test data --- backend/tests/factories.py | 137 +++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 backend/tests/factories.py diff --git a/backend/tests/factories.py b/backend/tests/factories.py new file mode 100644 index 00000000..829c1b4e --- /dev/null +++ b/backend/tests/factories.py @@ -0,0 +1,137 @@ +import factory +from login.models import OsmUser +from django.contrib.gis.geos import Polygon +from core.models import ( + Dataset, + AOI, + Label, + Model, + Training, + Feedback, + FeedbackAOI, + FeedbackLabel, +) + + +class OsmUserFactory(factory.django.DjangoModelFactory): + class Meta: + model = OsmUser + + osm_id = 123456 + + +class DatasetFactory(factory.django.DjangoModelFactory): + class Meta: + model = Dataset + + name = "My test dataset" + source_imagery = "https://tiles.openaerialmap.org/5ac4fc6f26964b0010033112/0/5ac4fc6f26964b0010033113/{z}/{x}/{y}" + created_by = factory.SubFactory(OsmUserFactory) + + +class AoiFactory(factory.django.DjangoModelFactory): + class Meta: + model = AOI + + geom = Polygon( + ( + (32.588507094820351, 0.348666499011499), + (32.588517512656978, 0.348184682976698), + (32.588869114643053, 0.348171660921362), + (32.588840465592334, 0.348679521066151), + (32.588507094820351, 0.348666499011499), + ) + ) + dataset = factory.SubFactory(DatasetFactory) + + +class LabelFactory(factory.django.DjangoModelFactory): + class Meta: + model = Label + + aoi = factory.SubFactory(AoiFactory) + geom = Polygon( + ( + (32.588507094820351, 0.348666499011499), + (32.588517512656978, 0.348184682976698), + (32.588869114643053, 0.348171660921362), + (32.588840465592334, 0.348679521066151), + (32.588507094820351, 0.348666499011499), + ) + ) + + +class ModelFactory(factory.django.DjangoModelFactory): + class Meta: + model = Model + + dataset = factory.SubFactory(DatasetFactory) + name = "My test model" + created_by = factory.SubFactory(OsmUserFactory) + + +class TrainingFactory(factory.django.DjangoModelFactory): + class Meta: + model = Training + + model = factory.SubFactory(ModelFactory) + description = "My very first training" + created_by = factory.SubFactory(OsmUserFactory) + epochs = 1 + zoom_level = [20, 21] + batch_size = 1 + + +class FeedbackFactory(factory.django.DjangoModelFactory): + class Meta: + model = Feedback + + geom = Polygon( + ( + (32.588507094820351, 0.348666499011499), + (32.588517512656978, 0.348184682976698), + (32.588869114643053, 0.348171660921362), + (32.588840465592334, 0.348679521066151), + (32.588507094820351, 0.348666499011499), + ) + ) + training = factory.SubFactory(TrainingFactory) + zoom_level = 19 + feedback_type = "TP" + user = factory.SubFactory(OsmUserFactory) + source_imagery = "https://tiles.openaerialmap.org/5ac4fc6f26964b0010033112/0/5ac4fc6f26964b0010033113/{z}/{x}/{y}" + + +class FeedbackAoiFactory(factory.django.DjangoModelFactory): + class Meta: + model = FeedbackAOI + + training = factory.SubFactory(TrainingFactory) + geom = Polygon( + ( + (32.588507094820351, 0.348666499011499), + (32.588517512656978, 0.348184682976698), + (32.588869114643053, 0.348171660921362), + (32.588840465592334, 0.348679521066151), + (32.588507094820351, 0.348666499011499), + ) + ) + label_status = -1 + source_imagery = "https://tiles.openaerialmap.org/5ac4fc6f26964b0010033112/0/5ac4fc6f26964b0010033113/{z}/{x}/{y}" + user = factory.SubFactory(OsmUserFactory) + + +class FeedbackLabelFactory(factory.django.DjangoModelFactory): + class Meta: + model = FeedbackLabel + + feedback_aoi = factory.SubFactory(FeedbackAoiFactory) + geom = Polygon( + ( + (32.588507094820351, 0.348666499011499), + (32.588517512656978, 0.348184682976698), + (32.588869114643053, 0.348171660921362), + (32.588840465592334, 0.348679521066151), + (32.588507094820351, 0.348666499011499), + ) + ) From 8c366fad2845610f28d37623001ca3215ec92cbc Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:07:27 +0100 Subject: [PATCH 03/11] test(endpoints-&-view): adds tests for the endpoints also adds test for view home - redirect --- backend/tests/test_endpoints.py | 268 ++++++++++++++++++++++++++------ backend/tests/test_views.py | 17 ++ 2 files changed, 234 insertions(+), 51 deletions(-) create mode 100644 backend/tests/test_views.py diff --git a/backend/tests/test_endpoints.py b/backend/tests/test_endpoints.py index a0447590..7b962117 100644 --- a/backend/tests/test_endpoints.py +++ b/backend/tests/test_endpoints.py @@ -2,9 +2,17 @@ import os import validators -from django.conf import settings from rest_framework import status from rest_framework.test import APILiveServerTestCase, RequestsClient +from .factories import ( + OsmUserFactory, + TrainingFactory, + DatasetFactory, + AoiFactory, + LabelFactory, + ModelFactory, + FeedbackAoiFactory, +) API_BASE = "http://testserver/api/v1" @@ -19,6 +27,12 @@ class TaskApiTest(APILiveServerTestCase): def setUp(self): # Create a request factory instance self.client = RequestsClient() + self.user = OsmUserFactory(osm_id=123) + self.dataset = DatasetFactory(created_by=self.user) + self.aoi = AoiFactory(dataset=self.dataset) + self.model = ModelFactory(dataset=self.dataset, created_by=self.user) + self.json_type_header = headersList.copy() + self.json_type_header["content-type"] = "application/json" def test_auth_me(self): res = self.client.get(f"{API_BASE}/auth/me/", headers=headersList) @@ -32,9 +46,11 @@ def test_auth_login(self): self.assertEqual(validators.url(res_body["login_url"]), True) def test_create_dataset(self): + # create dataset + payload = { - "name": "My test dataset", - "source_imagery": "https://tiles.openaerialmap.org/5ac4fc6f26964b0010033112/0/5ac4fc6f26964b0010033113/{z}/{x}/{y}", + "name": self.dataset.name, + "source_imagery": self.dataset.source_imagery, } # test without authentication should be forbidden res = self.client.post(f"{API_BASE}/dataset/", payload) @@ -43,22 +59,11 @@ def test_create_dataset(self): res = self.client.post(f"{API_BASE}/dataset/", payload, headers=headersList) self.assertEqual(res.status_code, status.HTTP_201_CREATED) - # now dataset is created , create first aoi inside it - payload_second = { - "geom": { - "type": "Polygon", - "coordinates": [ - [ - [32.588507094820351, 0.348666499011499], - [32.588517512656978, 0.348184682976698], - [32.588869114643053, 0.348171660921362], - [32.588840465592334, 0.348679521066151], - [32.588507094820351, 0.348666499011499], - ] - ], - }, - "dataset": 1, - } + def test_create_training(self): + # now dataset is created, create first aoi inside it + + payload_second = {"geom": self.aoi.geom.json, "dataset": self.dataset.id} + json_type_header = headersList json_type_header["content-type"] = "application/json" res = self.client.post( @@ -66,75 +71,115 @@ def test_create_dataset(self): ) self.assertEqual(res.status_code, status.HTTP_201_CREATED) - # create second aoi too , to test multiple aois + # create second aoi too, to test multiple aois + payload_third = { - "geom": { - "type": "Polygon", - "coordinates": [ - [ - [32.588046105549715, 0.349843692679227], - [32.588225813231475, 0.349484284008701], - [32.588624295482369, 0.349734307433132], - [32.588371662944233, 0.350088507273009], - [32.588046105549715, 0.349843692679227], - ] - ], - }, - "dataset": 1, + "geom": self.aoi.geom.json, + "dataset": self.dataset.id, } res = self.client.post( f"{API_BASE}/aoi/", json.dumps(payload_third), headers=json_type_header ) self.assertEqual(res.status_code, status.HTTP_201_CREATED) + # create model + + model_payload = {"name": self.model.name, "dataset": self.dataset.id} + res = self.client.post( + f"{API_BASE}/model/", json.dumps(model_payload), headers=json_type_header + ) + self.assertEqual(res.status_code, status.HTTP_201_CREATED) + + # create training without label + + training_payload = { + "description": "My very first training", + "epochs": 1, + "zoom_level": [20, 21], + "batch_size": 1, + "model": self.model.id, + } + res = self.client.post( + f"{API_BASE}/training/", + json.dumps(training_payload), + headers=json_type_header, + ) + print(res.json()) + self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) + # download labels from osm for 1 res = self.client.post( - f"{API_BASE}/label/osm/fetch/1/", "", headers=headersList + f"{API_BASE}/label/osm/fetch/{self.aoi.id}/", "", headers=headersList ) self.assertEqual(res.status_code, status.HTTP_201_CREATED) # download labels from osm for 2 res = self.client.post( - f"{API_BASE}/label/osm/fetch/2/", "", headers=headersList + f"{API_BASE}/label/osm/fetch/{self.aoi.id}/", "", headers=headersList ) self.assertEqual(res.status_code, status.HTTP_201_CREATED) - # build the dataset + # create training with epochs greater than the limit - build_dt_payload = {"dataset_id": 1, "zoom_level": ["19"]} + training_payload = { + "description": "My very first training", + "epochs": 31, + "zoom_level": [20, 21], + "batch_size": 1, + "model": self.model.id, + } res = self.client.post( - f"{API_BASE}/dataset/image/build/", - json.dumps(build_dt_payload), + f"{API_BASE}/training/", + json.dumps(training_payload), headers=json_type_header, ) - self.assertEqual(res.status_code, status.HTTP_201_CREATED) + print(res.json()) + self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) - # build dataset on multiple zoom levels + # create training with batch size greater than the limit - build_dt_payload = {"dataset_id": 1, "zoom_level": ["19", "20"]} + training_payload = { + "description": "My very first training", + "epochs": 1, + "zoom_level": [20, 21], + "batch_size": 9, + "model": self.model.id, + } res = self.client.post( - f"{API_BASE}/dataset/image/build/", - json.dumps(build_dt_payload), + f"{API_BASE}/training/", + json.dumps(training_payload), headers=json_type_header, ) - self.assertEqual(res.status_code, status.HTTP_201_CREATED) + print(res.json()) + self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) - # create model + # create training inside model - model_payload = {"name": "My test model", "dataset": 1} + training_payload = { + "description": "My very first training", + "epochs": 1, + "zoom_level": [20, 21], + "batch_size": 1, + "model": self.model.id, + } res = self.client.post( - f"{API_BASE}/model/", json.dumps(model_payload), headers=json_type_header + f"{API_BASE}/training/", + json.dumps(training_payload), + headers=json_type_header, ) + print(res.json()) self.assertEqual(res.status_code, status.HTTP_201_CREATED) - # create training inside model + # create another training for the same model + training_payload = { "description": "My very first training", "epochs": 1, + "zoom_level": [20, 21], "batch_size": 1, - "model": 1, + "model": self.model.id, } res = self.client.post( f"{API_BASE}/training/", @@ -142,5 +187,126 @@ def test_create_dataset(self): headers=json_type_header, ) print(res.json()) + self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) + + self.training = TrainingFactory(model=self.model, created_by=self.user) + + def test_create_label(self): + self.label = LabelFactory(aoi=self.aoi) + self.training = TrainingFactory(model=self.model, created_by=self.user) + + # create label + + label_payload = { + "geom": self.label.geom.json, + "aoi": self.aoi.id, + } + + res = self.client.post( + f"{API_BASE}/label/", + json.dumps(label_payload), + headers=self.json_type_header, + ) + self.assertEqual(res.status_code, status.HTTP_200_OK) # 201- for create + + # create another label with the same geom and aoi + + label_payload2 = { + "geom": self.label.geom.json, + "aoi": self.aoi.id, + } + + res = self.client.post( + f"{API_BASE}/label/", + json.dumps(label_payload2), + headers=self.json_type_header, + ) + self.assertEqual(res.status_code, status.HTTP_200_OK) # 200- for update + + # create another label with error + + label_payload3 = { + "geom": self.label.geom.json, + "aoi": 40, # non-existent aoi + } + res = self.client.post( + f"{API_BASE}/label/", + json.dumps(label_payload3), + headers=self.json_type_header, + ) + self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) + + def test_fetch_feedbackAoi_osm_label(self): + # create feedback aoi + training = TrainingFactory(model=self.model, created_by=self.user) + feedbackAoi = FeedbackAoiFactory(training=training, user=self.user) + + # download available osm data as labels for the feedback aoi + + res = self.client.post( + f"{API_BASE}/label/feedback/osm/fetch/{feedbackAoi.id}/", + "", + headers=headersList, + ) + self.assertEqual(res.status_code, status.HTTP_201_CREATED) + + def test_get_runStatus(self): + training = TrainingFactory(model=self.model, created_by=self.user) + + # get running training status + + res = self.client.get( + f"{API_BASE}/training/status/{training.id}/", headers=headersList + ) + self.assertEqual(res.status_code, status.HTTP_200_OK) + + def test_submit_training_feedback(self): + training = TrainingFactory(model=self.model, created_by=self.user) + + # apply feedback to training published checkpoints + + training_feedback_payload = { + "training_id": training.id, + "epochs": 20, + "batch_size": 8, + "zoom_level": [19, 20], + } + res = self.client.post( + f"{API_BASE}/feedback/training/submit/", + json.dumps(training_feedback_payload), + headers=self.json_type_header, + ) + # submit unfished/unpublished training feedback should not pass + self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) + + def test_publish_training(self): + training = TrainingFactory(model=self.model, created_by=self.user) + + # publish an unfinished training should not pass + + res = self.client.post( + f"{API_BASE}/training/publish/{training.id}/", headers=headersList + ) + self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND) + + def test_get_GpxView(self): + training = TrainingFactory(model=self.model, created_by=self.user) + feedbackAoi = FeedbackAoiFactory(training=training, user=self.user) + + # generate aoi GPX view - aoi_id + + res = self.client.get(f"{API_BASE}/aoi/gpx/{self.aoi.id}/", headers=headersList) + self.assertEqual(res.status_code, status.HTTP_200_OK) + + # generate feedback aoi GPX view - feedback aoi_id + + res = self.client.get( + f"{API_BASE}/feedback-aoi/gpx/{feedbackAoi.id}/", headers=headersList + ) + self.assertEqual(res.status_code, status.HTTP_200_OK) + + def test_get_workspace(self): + # get training workspace + + res = self.client.get(f"{API_BASE}/workspace/", headers=headersList) self.assertEqual(res.status_code, status.HTTP_201_CREATED) - # test diff --git a/backend/tests/test_views.py b/backend/tests/test_views.py new file mode 100644 index 00000000..991ae1bd --- /dev/null +++ b/backend/tests/test_views.py @@ -0,0 +1,17 @@ +from django.test import TestCase +from django.urls import reverse +from rest_framework import status +from rest_framework.test import APIClient + +BASE_URL = "http://testserver/api" + + +class CoreViewsTest(TestCase): + def setUp(self): + self.client = APIClient() + self.home_url = f"{BASE_URL}/" + + def test_home_redirect(self): + res = self.client.get(self.home_url) + self.assertEqual(res.status_code, status.HTTP_302_FOUND) + self.assertRedirects(res, reverse("schema-swagger-ui")) From 47f59fec4a3119773f8753c5bc0b7e44bc602ec9 Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:38:09 +0100 Subject: [PATCH 04/11] test(exclude-coverage): omit everything in /usr from coverage --- backend/pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 3c813601..e1eb0f5b 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -46,6 +46,7 @@ distribution = true dev = [ "commitizen>=3.27.0", "ruff>=0.4.9", + "coverage>=7.6.0", ] [tool.commitizen] @@ -54,3 +55,8 @@ tag_format = "\"v$version\"" version_scheme = "semver2" version = "1.0.1" update_changelog_on_bump = true + +[tool.coverage.run] +omit = [ + "/usr/*" +] From 0aee788eaa91c03973d4e8d6051898232fdc7833 Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:50:56 +0100 Subject: [PATCH 05/11] test(test-backend-build): adds run project tests in Github action workflow to run automatic tests on PR --- .github/workflows/backend_build.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index 7983b9a6..aff2922b 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -55,10 +55,15 @@ jobs: - name: Unzip and Move Basemodel run: unzip checkpoint.tf.zip -d ramp-code/ramp + - name: Install numpy + run: | + pip install numpy + - name: Install gdal run: | sudo apt-get update && sudo apt-get -y install gdal-bin libgdal-dev python3-gdal && sudo apt-get -y autoremove && sudo apt-get clean pip install GDAL==$(gdal-config --version) + - name: Install ramp dependecies run: | cd ramp-code && cd colab && make install @@ -85,7 +90,8 @@ jobs: - name: Install Dependencies run: | cd backend/ - pip install -r requirements.txt + pip install pdm + pdm install - name: Creating env run: | @@ -104,12 +110,6 @@ jobs: cd backend/ celery -A aiproject --broker=redis://localhost:6379/ flower & - - name: Fix gdal array - run: | - pip uninstall -y gdal - pip install numpy - pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal" - - name: Check Opencv version run: | pip freeze | grep opencv @@ -121,11 +121,5 @@ jobs: run: | cd backend/ - - export TESTING_TOKEN=$TESTING_TOKEN - python manage.py makemigrations - python manage.py makemigrations core - python manage.py makemigrations login - python manage.py migrate - python manage.py migrate login - python manage.py migrate core + coverage run manage.py test tests + coverage report From f86dc4d7249244ab56feafe520e6fb5c6caf44d1 Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:06:37 +0100 Subject: [PATCH 06/11] test(fix-backend-build): fixes install dependecies failing --- .github/workflows/backend_build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index aff2922b..06abd1b0 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -55,15 +55,10 @@ jobs: - name: Unzip and Move Basemodel run: unzip checkpoint.tf.zip -d ramp-code/ramp - - name: Install numpy - run: | - pip install numpy - - name: Install gdal run: | sudo apt-get update && sudo apt-get -y install gdal-bin libgdal-dev python3-gdal && sudo apt-get -y autoremove && sudo apt-get clean pip install GDAL==$(gdal-config --version) - - name: Install ramp dependecies run: | cd ramp-code && cd colab && make install @@ -110,6 +105,12 @@ jobs: cd backend/ celery -A aiproject --broker=redis://localhost:6379/ flower & + - name: Fix gdal array + run: | + pip uninstall -y gdal + pip install numpy + pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal" + - name: Check Opencv version run: | pip freeze | grep opencv @@ -121,5 +122,7 @@ jobs: run: | cd backend/ + + export TESTING_TOKEN=$TESTING_TOKEN coverage run manage.py test tests coverage report From 9c0e5ff2d78437857bf59240ba387ecc547e2f51 Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:20:51 +0100 Subject: [PATCH 07/11] test(backend-build): restores install project dependencies --- .github/workflows/backend_build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index 06abd1b0..b0e23575 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -85,8 +85,7 @@ jobs: - name: Install Dependencies run: | cd backend/ - pip install pdm - pdm install + pip install -r requirements.txt - name: Creating env run: | From 656e26858d1fdac4d9de8bac66f9bb5104d4aa9c Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:19:29 +0100 Subject: [PATCH 08/11] test(backend-build): adds install coverage --- .github/workflows/backend_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index b0e23575..f0fe307b 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -121,6 +121,7 @@ jobs: run: | cd backend/ + pip install coverage export TESTING_TOKEN=$TESTING_TOKEN coverage run manage.py test tests From 7b8ac72aba11e876a7d05f29af6723483b3b49cb Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:56:48 +0100 Subject: [PATCH 09/11] test(github-action): restores makemigrations --- .github/workflows/backend_build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index f0fe307b..992e1eac 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -121,8 +121,15 @@ jobs: run: | cd backend/ - pip install coverage export TESTING_TOKEN=$TESTING_TOKEN + python manage.py makemigrations + python manage.py makemigrations core + python manage.py makemigrations login + python manage.py migrate + python manage.py migrate login + python manage.py migrate core + + pip install coverage coverage run manage.py test tests coverage report From 7fd9f858fd8709b20ce14d532002207e77d972f2 Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:14:49 +0100 Subject: [PATCH 10/11] test(github-action): adds install factory boy --- .github/workflows/backend_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index 992e1eac..c27c7675 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -131,5 +131,6 @@ jobs: python manage.py migrate core pip install coverage + pip install factory-boy coverage run manage.py test tests coverage report From 3917c9d0acd856f6aa54dc7cb13bfe60376a253c Mon Sep 17 00:00:00 2001 From: Oluwanifemi Daramola <76186151+nifedara@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:14:31 +0100 Subject: [PATCH 11/11] ci(backend-build): runs tests on pr --- .github/workflows/backend_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backend_build.yml b/.github/workflows/backend_build.yml index c27c7675..3b8a1863 100644 --- a/.github/workflows/backend_build.yml +++ b/.github/workflows/backend_build.yml @@ -117,7 +117,7 @@ jobs: - name: Run tests env: - TESTING_TOKEN: ${{ secrets.TESTING_TOKEN }} + TESTING_TOKEN: ${{ os.environ['TESTING_TOKEN'] }} run: | cd backend/