Skip to content

Commit

Permalink
dockerize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaingaudan committed Jul 17, 2024
1 parent 0c44e76 commit 341515c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 27 deletions.
5 changes: 3 additions & 2 deletions test/agate_tests.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import json
import os
import unittest
from test.utils import (AGATE_ENDPOINT, AIRS_URL, ARLAS_COLLECTION, ARLAS_URL,
ASSET, ASSET_PATH, COLLECTION, ID, ITEM_PATH,
index_collection_prefix, setUpTest)
from time import sleep

import requests
from utils import (AGATE_ENDPOINT, AIRS_URL, ARLAS_COLLECTION, ARLAS_URL,
ASSET, ASSET_PATH, COLLECTION, ID, ITEM_PATH, setUpTest, index_collection_prefix)

from airs.core.models import mapper
from airs.core.models.model import Item
Expand Down
12 changes: 7 additions & 5 deletions test/airs_tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import requests
import unittest
import os
import unittest
from test.utils import (AIRS_URL, ASSET, ASSET_PATH, COLLECTION, ID, ITEM_PATH,
index_collection_prefix, index_endpoint_url, setUpTest)

import elasticsearch
import requests

from airs.core.models import mapper as mapper
from utils import setUpTest, index_endpoint_url, ITEM_PATH, AIRS_URL, COLLECTION, ID, ASSET, ASSET_PATH, \
index_collection_prefix


class Tests(unittest.TestCase):
Expand Down Expand Up @@ -80,7 +82,7 @@ def test_access_asset(self):
# FILE FOUND FOR THE MANAGED ASSET
r=requests.get(url=os.path.join(AIRS_URL,"collections",COLLECTION, "items", ID))
item=mapper.item_from_json(r.content)
location = item.assets["data"].href.replace("minio", "localhost")
location = item.assets["data"].href
r=requests.head(url=location)
self.assertTrue(r.ok, str(r.status_code)+str(r.content))

Expand Down
25 changes: 13 additions & 12 deletions test/aproc_download_tests.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import unittest
import json
import os
import unittest
from test.utils import (AIRS_URL, APROC_ENDPOINT, ARLAS_COLLECTION, ARLAS_URL,
ASSET, ASSET_PATH, COLLECTION, ID, ITEM_PATH,
SMTP_SERVER, TOKEN, index_collection_prefix, setUpTest)
from time import sleep
import requests
import json
from airs.core.models import mapper
from airs.core.models.model import Item, Asset, Role
from aproc.core.models.ogc.process import ProcessList, ProcessDescription
from extensions.aproc.proc.download.download_process import InputDownloadProcess, OutputDownloadProcess

from utils import AIRS_URL, APROC_ENDPOINT, ARLAS_COLLECTION, ARLAS_URL, TOKEN, setUpTest
import requests

from airs.core.models import mapper
from airs.core.models.model import Item
from aproc.core.models.ogc import Execute
from aproc.core.models.ogc.job import StatusCode, StatusInfo
from aproc.core.models.ogc import (Execute)
from utils import setUpTest, index_endpoint_url, ITEM_PATH, AIRS_URL, COLLECTION, ID, ASSET, ASSET_PATH, SMTP_SERVER, \
index_collection_prefix
from aproc.core.models.ogc.process import ProcessList
from extensions.aproc.proc.download.download_process import (
InputDownloadProcess, OutputDownloadProcess)


class Tests(unittest.TestCase):

def setUp(self):
setUpTest()
requests.delete(SMTP_SERVER+"/*")
requests.delete(SMTP_SERVER + "/*")

def test_download_exists(self):
# CHECK THE DOWNLOAD PROCESS EXISTS
Expand Down
10 changes: 5 additions & 5 deletions test/aproc_ingest_heavyload_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import os
import time
import unittest
from test.utils import (APROC_ENDPOINT, COLLECTION, THEIA_DIR,
setUpTest)
from time import sleep

import requests
from extensions.aproc.proc.ingest.directory_ingest_process import InputDirectoryIngestProcess
from utils import AIRS_URL, APROC_ENDPOINT, setUpTest, COLLECTION, THEIA_DIR

from aproc.core.models.ogc import Execute
from aproc.core.models.ogc.job import StatusCode, StatusInfo
from aproc.core.processes.processes import Processes
from extensions.aproc.proc.ingest.ingest_process import InputIngestProcess
from aproc.core.models.ogc import (Conforms, ExceptionType, Execute)
from extensions.aproc.proc.ingest.directory_ingest_process import \
InputDirectoryIngestProcess

BATCH_ROOT_SIZE = 31

Expand Down
2 changes: 1 addition & 1 deletion test/aproc_ingest_tests.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
import unittest
from test.utils import APROC_ENDPOINT, COLLECTION, setUpTest
from time import sleep

import requests
from test.utils import APROC_ENDPOINT, COLLECTION, setUpTest

from aproc.core.models.ogc import Execute
from aproc.core.models.ogc.job import StatusCode, StatusInfo
Expand Down
2 changes: 1 addition & 1 deletion test/fam_tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import os
import unittest
from test.utils import FAM_URL

import requests
from fastapi import status
from utils import FAM_URL

from fam.core.model import Archive, File, PathRequest

Expand Down
2 changes: 1 addition & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ARLAS_URL = "http://arlas-server:9999"
APROC_ENDPOINT = os.getenv("APROC_ENDPOINT", "http://aproc-service:8001/arlas/aproc")
AGATE_ENDPOINT = os.getenv("AGATE_ENDPOINT", "http://agate:8004/arlas/agate/authorization")
SMTP_SERVER="http://smtp4dev:3000/api/Messages"
SMTP_SERVER="http://smtp4dev:80/api/Messages"
COLLECTION="digitalearth.africa"
ARLAS_COLLECTION="digitalearth.africa"
ID="077cb463-1f68-5532-aa8b-8df0b510231a"
Expand Down

0 comments on commit 341515c

Please sign in to comment.