From 1633d98305ea71e235944d4253296f2002fe59e7 Mon Sep 17 00:00:00 2001 From: lxShaDoWxl Date: Thu, 13 Apr 2023 18:31:33 +0600 Subject: [PATCH] tests(gitlab): remove old data and actualization test Signed-off-by: lxShaDoWxl --- src/pkg/reg/adapter/gitlab/adapter_test.go | 10 +- .../gitlab/testdata/projects/-docker.json | 97 ------------------- .../gitlab/testdata/projects/dev-.json | 96 ------------------ 3 files changed, 2 insertions(+), 201 deletions(-) delete mode 100644 src/pkg/reg/adapter/gitlab/testdata/projects/-docker.json delete mode 100644 src/pkg/reg/adapter/gitlab/testdata/projects/dev-.json diff --git a/src/pkg/reg/adapter/gitlab/adapter_test.go b/src/pkg/reg/adapter/gitlab/adapter_test.go index adaab5234951..ccda60b53759 100644 --- a/src/pkg/reg/adapter/gitlab/adapter_test.go +++ b/src/pkg/reg/adapter/gitlab/adapter_test.go @@ -38,16 +38,10 @@ func getServer(t *testing.T) *httptest.Server { w.Header().Set("X-Next-Page", "") switch search { - case "dev-docker": + case "library/dev-docker", "library", "library/", "dev-docker/", "dev-docker": mustWriteHTTPResponse(t, w, "testdata/projects/dev-docker.json") break - case "dev-": - mustWriteHTTPResponse(t, w, "testdata/projects/dev-docker.json") - break - case "-docker": - mustWriteHTTPResponse(t, w, "testdata/projects/-docker.json") - break - case "": + case "", "library/dockers": mustWriteHTTPResponse(t, w, "testdata/projects/all.json") break default: diff --git a/src/pkg/reg/adapter/gitlab/testdata/projects/-docker.json b/src/pkg/reg/adapter/gitlab/testdata/projects/-docker.json deleted file mode 100644 index 3bd096f8bfdf..000000000000 --- a/src/pkg/reg/adapter/gitlab/testdata/projects/-docker.json +++ /dev/null @@ -1,97 +0,0 @@ -[ - { - "id": 3, - "description": "", - "name": "dev-docker", - "name_with_namespace": "Library / dev-docker", - "path": "dev-docker", - "path_with_namespace": "library/dev-docker", - "created_at": "2019-01-17T09:47:07.504Z", - "default_branch": "master", - "tag_list": [], - - "avatar_url": null, - "star_count": 0, - "forks_count": 0, - "last_activity_at": "2019-06-09T15:18:10.045Z", - "empty_repo": false, - "archived": false, - "visibility": "private", - "resolve_outdated_diff_discussions": false, - "container_registry_enabled": true, - "issues_enabled": true, - "merge_requests_enabled": true, - "wiki_enabled": true, - "jobs_enabled": true, - "snippets_enabled": true, - "shared_runners_enabled": true, - "lfs_enabled": true, - "creator_id": 1, - "forked_from_project": {}, - "import_status": "finished", - "open_issues_count": 0, - "ci_default_git_depth": null, - "public_jobs": true, - "ci_config_path": null, - "shared_with_groups": [], - "only_allow_merge_if_pipeline_succeeds": false, - "request_access_enabled": false, - "only_allow_merge_if_all_discussions_are_resolved": false, - "printing_merge_request_link_enabled": true, - "merge_method": "merge", - "external_authorization_classification_label": "", - "permissions": { - "project_access": null, - "group_access": null - }, - "mirror": false - }, - { - "id": 4, - "description": "", - "name": "dev-docker-test", - "name_with_namespace": "Library / dev-docker-test", - "path": "dev-docker-test", - "path_with_namespace": "library/dev-docker-test", - "created_at": "2019-01-17T09:47:07.504Z", - "default_branch": "master", - "tag_list": [], - - "avatar_url": null, - "star_count": 0, - "forks_count": 0, - "last_activity_at": "2019-06-09T15:18:10.045Z", - "empty_repo": false, - "archived": false, - "visibility": "private", - "resolve_outdated_diff_discussions": false, - "container_registry_enabled": true, - "issues_enabled": true, - "merge_requests_enabled": true, - "wiki_enabled": true, - "jobs_enabled": true, - "snippets_enabled": true, - "shared_runners_enabled": true, - "lfs_enabled": true, - "creator_id": 1, - "forked_from_project": {}, - "import_status": "finished", - "open_issues_count": 0, - "ci_default_git_depth": null, - "public_jobs": true, - "ci_config_path": null, - "shared_with_groups": [], - "only_allow_merge_if_pipeline_succeeds": false, - "request_access_enabled": false, - "only_allow_merge_if_all_discussions_are_resolved": false, - "printing_merge_request_link_enabled": true, - "merge_method": "merge", - "external_authorization_classification_label": "", - "permissions": { - "project_access": null, - "group_access": null - }, - "mirror": false - } - -] \ No newline at end of file diff --git a/src/pkg/reg/adapter/gitlab/testdata/projects/dev-.json b/src/pkg/reg/adapter/gitlab/testdata/projects/dev-.json deleted file mode 100644 index 7c1b6237c165..000000000000 --- a/src/pkg/reg/adapter/gitlab/testdata/projects/dev-.json +++ /dev/null @@ -1,96 +0,0 @@ -[ - { - "id": 3, - "description": "", - "name": "dev-docker", - "name_with_namespace": "Library / dev-docker", - "path": "dev-docker", - "path_with_namespace": "library/dev-docker", - "created_at": "2019-01-17T09:47:07.504Z", - "default_branch": "master", - "tag_list": [], - - "avatar_url": null, - "star_count": 0, - "forks_count": 0, - "last_activity_at": "2019-06-09T15:18:10.045Z", - "empty_repo": false, - "archived": false, - "visibility": "private", - "resolve_outdated_diff_discussions": false, - "container_registry_enabled": true, - "issues_enabled": true, - "merge_requests_enabled": true, - "wiki_enabled": true, - "jobs_enabled": true, - "snippets_enabled": true, - "shared_runners_enabled": true, - "lfs_enabled": true, - "creator_id": 1, - "forked_from_project": {}, - "import_status": "finished", - "open_issues_count": 0, - "ci_default_git_depth": null, - "public_jobs": true, - "ci_config_path": null, - "shared_with_groups": [], - "only_allow_merge_if_pipeline_succeeds": false, - "request_access_enabled": false, - "only_allow_merge_if_all_discussions_are_resolved": false, - "printing_merge_request_link_enabled": true, - "merge_method": "merge", - "external_authorization_classification_label": "", - "permissions": { - "project_access": null, - "group_access": null - }, - "mirror": false - }, - { - "id": 4, - "description": "", - "name": "dev-docker-test", - "name_with_namespace": "Library / dev-docker-test", - "path": "dev-docker-test", - "path_with_namespace": "library/dev-docker-test", - "created_at": "2019-01-17T09:47:07.504Z", - "default_branch": "master", - "tag_list": [], - - "avatar_url": null, - "star_count": 0, - "forks_count": 0, - "last_activity_at": "2019-06-09T15:18:10.045Z", - "empty_repo": false, - "archived": false, - "visibility": "private", - "resolve_outdated_diff_discussions": false, - "container_registry_enabled": true, - "issues_enabled": true, - "merge_requests_enabled": true, - "wiki_enabled": true, - "jobs_enabled": true, - "snippets_enabled": true, - "shared_runners_enabled": true, - "lfs_enabled": true, - "creator_id": 1, - "forked_from_project": {}, - "import_status": "finished", - "open_issues_count": 0, - "ci_default_git_depth": null, - "public_jobs": true, - "ci_config_path": null, - "shared_with_groups": [], - "only_allow_merge_if_pipeline_succeeds": false, - "request_access_enabled": false, - "only_allow_merge_if_all_discussions_are_resolved": false, - "printing_merge_request_link_enabled": true, - "merge_method": "merge", - "external_authorization_classification_label": "", - "permissions": { - "project_access": null, - "group_access": null - }, - "mirror": false - } -] \ No newline at end of file