From 2ae5830239a808878f5a8e186471acb8399d46e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Sun, 14 Jun 2026 20:14:32 +0200 Subject: [PATCH] [debian] swagger: remove test --- Makefile | 4 ++-- files/public.go | 14 +++++++------- system/t02_config/CreateConfigTest_gold | 3 ++- system/t12_api/docs.py | 17 ----------------- 4 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 system/t12_api/docs.py diff --git a/Makefile b/Makefile index 09537d42..d12809d1 100644 --- a/Makefile +++ b/Makefile @@ -75,9 +75,9 @@ azurite-start: azurite-stop: @kill `cat ~/.azurite.pid` -swagger: swagger-install +swagger: #swagger-install # Generate swagger docs - @PATH=$(BINPATH)/:$(PATH) swag init --parseDependency --parseInternal --markdownFiles docs --generalInfo docs/swagger.conf + #@PATH=$(BINPATH)/:$(PATH) swag init --parseDependency --parseInternal --markdownFiles docs --generalInfo docs/swagger.conf etcd-install: # Install etcd diff --git a/files/public.go b/files/public.go index 3a0306e6..dea35ea8 100644 --- a/files/public.go +++ b/files/public.go @@ -169,7 +169,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, var dstStat os.FileInfo - dstStat, err = os.Stat(filepath.Join(poolPath, baseName)) + dstStat, err = os.Stat(destinationPath) if err == nil { // already exists, check source file @@ -188,7 +188,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, } else { // if source and destination have the same checksums, no need to copy var dstMD5 string - dstMD5, err = utils.MD5ChecksumForFile(filepath.Join(poolPath, baseName)) + dstMD5, err = utils.MD5ChecksumForFile(destinationPath) if err != nil { return err @@ -219,11 +219,11 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, // source and destination have different inodes, if !forced, this is fatal error if !force { - return fmt.Errorf("error linking file to %s: file already exists and is different", filepath.Join(poolPath, baseName)) + return fmt.Errorf("error linking file to %s: file already exists and is different", destinationPath) } // forced, so remove destination - err = os.Remove(filepath.Join(poolPath, baseName)) + err = os.Remove(destinationPath) if err != nil { return err } @@ -238,7 +238,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, } var dst *os.File - dst, err = os.Create(filepath.Join(poolPath, baseName)) + dst, err = os.Create(destinationPath) if err != nil { _ = r.Close() return err @@ -266,9 +266,9 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, err = dst.Close() } else if storage.linkMethod == LinkMethodSymLink { - err = localSourcePool.Symlink(sourcePath, filepath.Join(poolPath, baseName)) + err = localSourcePool.Symlink(sourcePath, destinationPath) } else { - err = localSourcePool.Link(sourcePath, filepath.Join(poolPath, baseName)) + err = localSourcePool.Link(sourcePath, destinationPath) } return err diff --git a/system/t02_config/CreateConfigTest_gold b/system/t02_config/CreateConfigTest_gold index 54360870..73d0ff38 100644 --- a/system/t02_config/CreateConfigTest_gold +++ b/system/t02_config/CreateConfigTest_gold @@ -83,8 +83,9 @@ serve_in_api_mode: false # Enable metrics for Prometheus client enable_metrics_endpoint: false +# Not implemented in this version. # Enable API documentation on /docs -enable_swagger_endpoint: false +#enable_swagger_endpoint: false # OBSOLETE: use via url param ?_async=true async_api: false diff --git a/system/t12_api/docs.py b/system/t12_api/docs.py deleted file mode 100644 index 50a7b1cb..00000000 --- a/system/t12_api/docs.py +++ /dev/null @@ -1,17 +0,0 @@ -from api_lib import APITest - - -class TaskAPITestSwaggerDocs(APITest): - """ - GET /docs - """ - - def check(self): - resp = self.get("/docs/doc.json") - self.check_equal(resp.status_code, 200) - - resp = self.get("/docs/", allow_redirects=False) - self.check_equal(resp.status_code, 301) - - resp = self.get("/docs/index.html") - self.check_equal(resp.status_code, 200)