implement system tests for serving api and published repos simultaneously

This commit is contained in:
Markus Muellner
2023-03-17 17:04:02 +01:00
committed by Benj Fassbind
parent e25ade8af3
commit f74217ed9c
4 changed files with 119 additions and 23 deletions
+12 -3
View File
@@ -24,6 +24,14 @@ class APITest(BaseTest):
"""
aptly_server = None
base_url = "127.0.0.1:8765"
configOverride = {
"FileSystemPublishEndpoints": {
"apiandserve": {
"rootDir": f"{os.environ['HOME']}/{BaseTest.aptlyDir}/apiandserve",
"linkMethod": "symlink"
}
}
}
def fixture_available(self):
return super(APITest, self).fixture_available() and requests is not None
@@ -32,11 +40,12 @@ class APITest(BaseTest):
if APITest.aptly_server is None:
super(APITest, self).prepare()
APITest.aptly_server = self._start_process("aptly api serve -no-lock -listen=%s" % (self.base_url),)
configPath = os.path.join(os.environ["HOME"], self.aptlyConfigFile)
APITest.aptly_server = self._start_process(f"aptly api serve -no-lock -config={configPath} -listen={self.base_url}",)
time.sleep(1)
if os.path.exists(os.path.join(os.environ["HOME"], ".aptly", "upload")):
shutil.rmtree(os.path.join(os.environ["HOME"], ".aptly", "upload"))
if os.path.exists(os.path.join(os.environ["HOME"], self.aptlyDir, "upload")):
shutil.rmtree(os.path.join(os.environ["HOME"], self.aptlyDir, "upload"))
def run(self):
pass