From cd6afb9fb881c0e4c5344a2961064305f0043e7a Mon Sep 17 00:00:00 2001 From: amimas Date: Mon, 1 Jan 2024 10:16:08 -0500 Subject: [PATCH 01/12] Update test_transfer_project.py --- .../standard/test_transfer_project.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/standard/test_transfer_project.py b/tests/acceptance/standard/test_transfer_project.py index c4bac4ddb..fa22392aa 100644 --- a/tests/acceptance/standard/test_transfer_project.py +++ b/tests/acceptance/standard/test_transfer_project.py @@ -9,15 +9,17 @@ class TestTransferProject: - def test__transfer_between_two_root_groups(self, project, group, other_group): - project_new_path_with_namespace = f"{other_group.path}/{project.name}" + def test__transfer_between_two_root_groups( + self, project_for_function, group, other_group + ): + project_new_path_with_namespace = f"{other_group.path}/{project_for_function.name}" projects_in_destination_before_transfer = other_group.projects.list() config = f""" projects_and_groups: {project_new_path_with_namespace}: project: - transfer_from: {project.path_with_namespace} + transfer_from: {project_for_function.path_with_namespace} """ run_gitlabform(config, project_new_path_with_namespace) @@ -31,8 +33,8 @@ def test__transfer_between_two_root_groups(self, project, group, other_group): # Now test the transfer the opposite direction by transferring the same project back to the original group # Transferring the project to the original location also helps because the fixtures used in this test is shared # with other tests and they will need the fixture in its original form. - project_new_path_with_namespace = f"{group.path}/{project.name}" - project_source = f"{other_group.path}/{project.name}" + project_new_path_with_namespace = f"{group.path}/{project_for_function.name}" + project_source = f"{other_group.path}/{project_for_function.name}" projects_in_destination_before_transfer = group.projects.list() config = f""" @@ -96,16 +98,16 @@ def test__transfer_between_root_group_and_subgroup( ) def test__transfer_as_same_path_at_namespae_already_exist( - self, project, group, other_group + self, project_for_function, group, other_group ): - project_new_path_with_namespace = f"{other_group.path}/{project.name}" + project_new_path_with_namespace = f"{other_group.path}/{project_for_function.name}" projects_in_destination_before_transfer = other_group.projects.list() config = f""" projects_and_groups: {project_new_path_with_namespace}: project: - transfer_from: {project.path_with_namespace} + transfer_from: {project_for_function.path_with_namespace} """ run_gitlabform(config, project_new_path_with_namespace) From 00d0be2928f05d1ff9b86ed5c34bbd3e9bfa0839 Mon Sep 17 00:00:00 2001 From: amimas Date: Mon, 1 Jan 2024 11:41:06 -0500 Subject: [PATCH 02/12] Update test_transfer_project.py --- .../standard/test_transfer_project.py | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/acceptance/standard/test_transfer_project.py b/tests/acceptance/standard/test_transfer_project.py index fa22392aa..6318eaf04 100644 --- a/tests/acceptance/standard/test_transfer_project.py +++ b/tests/acceptance/standard/test_transfer_project.py @@ -33,24 +33,24 @@ def test__transfer_between_two_root_groups( # Now test the transfer the opposite direction by transferring the same project back to the original group # Transferring the project to the original location also helps because the fixtures used in this test is shared # with other tests and they will need the fixture in its original form. - project_new_path_with_namespace = f"{group.path}/{project_for_function.name}" - project_source = f"{other_group.path}/{project_for_function.name}" - projects_in_destination_before_transfer = group.projects.list() - - config = f""" - projects_and_groups: - {project_new_path_with_namespace}: - project: - transfer_from: {project_source} - """ - - run_gitlabform(config, project_new_path_with_namespace) - projects_in_destination_after_transfer = group.projects.list() - - assert ( - len(projects_in_destination_after_transfer) - == len(projects_in_destination_before_transfer) + 1 - ) + # project_new_path_with_namespace = f"{group.path}/{project_for_function.name}" + # project_source = f"{other_group.path}/{project_for_function.name}" + # projects_in_destination_before_transfer = group.projects.list() + + # config = f""" + # projects_and_groups: + # {project_new_path_with_namespace}: + # project: + # transfer_from: {project_source} + # """ + + # run_gitlabform(config, project_new_path_with_namespace) + # projects_in_destination_after_transfer = group.projects.list() + + # assert ( + # len(projects_in_destination_after_transfer) + # == len(projects_in_destination_before_transfer) + 1 + # ) def test__transfer_between_root_group_and_subgroup( self, project_in_subgroup, group, subgroup From 02fdc90617cac4c32eba1f0c6056997f93924eb1 Mon Sep 17 00:00:00 2001 From: amimas Date: Mon, 1 Jan 2024 12:01:06 -0500 Subject: [PATCH 03/12] Update test_transfer_project.py --- .../standard/test_transfer_project.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/acceptance/standard/test_transfer_project.py b/tests/acceptance/standard/test_transfer_project.py index 6318eaf04..effc3dad3 100644 --- a/tests/acceptance/standard/test_transfer_project.py +++ b/tests/acceptance/standard/test_transfer_project.py @@ -76,26 +76,26 @@ def test__transfer_between_root_group_and_subgroup( # Now test the transfer the opposite direction by transferring the same project back to the original group # Transferring the project to the original location also helps because the fixtures used in this test is shared # with other tests and they will need the fixture in its original form. - project_new_path_with_namespace = ( - f"{group.path}/{subgroup.path}/{project_in_subgroup.name}" - ) - project_source = f"{group.path}/{project_in_subgroup.name}" - projects_in_destination_before_transfer = subgroup.projects.list() + # project_new_path_with_namespace = ( + # f"{group.path}/{subgroup.path}/{project_in_subgroup.name}" + # ) + # project_source = f"{group.path}/{project_in_subgroup.name}" + # projects_in_destination_before_transfer = subgroup.projects.list() - config = f""" - projects_and_groups: - {project_new_path_with_namespace}: - project: - transfer_from: {project_source} - """ + # config = f""" + # projects_and_groups: + # {project_new_path_with_namespace}: + # project: + # transfer_from: {project_source} + # """ - run_gitlabform(config, project_new_path_with_namespace) - projects_in_destination_after_transfer = subgroup.projects.list() + # run_gitlabform(config, project_new_path_with_namespace) + # projects_in_destination_after_transfer = subgroup.projects.list() - assert ( - len(projects_in_destination_after_transfer) - == len(projects_in_destination_before_transfer) + 1 - ) + # assert ( + # len(projects_in_destination_after_transfer) + # == len(projects_in_destination_before_transfer) + 1 + # ) def test__transfer_as_same_path_at_namespae_already_exist( self, project_for_function, group, other_group From e05ddf025ea1905f9db1c9f93b3d8dd2bec1a93b Mon Sep 17 00:00:00 2001 From: amimas Date: Mon, 1 Jan 2024 13:57:08 -0500 Subject: [PATCH 04/12] Update pr-linter-and-tests.yml --- .github/workflows/pr-linter-and-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-linter-and-tests.yml b/.github/workflows/pr-linter-and-tests.yml index d2ca4d091..61598ba67 100644 --- a/.github/workflows/pr-linter-and-tests.yml +++ b/.github/workflows/pr-linter-and-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Black Code Formatter uses: gdubicki/black-action@main with: - args: ". --check" + args: ". --diff" types: runs-on: ubuntu-latest From 6a6184047b5cc6d41767a12d918f31b13d32a9c8 Mon Sep 17 00:00:00 2001 From: amimas Date: Mon, 1 Jan 2024 14:01:34 -0500 Subject: [PATCH 05/12] Update linter-and-tests.yml --- .github/workflows/linter-and-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linter-and-tests.yml b/.github/workflows/linter-and-tests.yml index 492d78864..5665d8da5 100644 --- a/.github/workflows/linter-and-tests.yml +++ b/.github/workflows/linter-and-tests.yml @@ -4,6 +4,8 @@ on: push: branches: - main + - transfer-test + - test-transfer jobs: black-formatting: From 444f195c2bc894f45afdc51fcbe3460f1fc99023 Mon Sep 17 00:00:00 2001 From: amimas Date: Mon, 1 Jan 2024 14:03:25 -0500 Subject: [PATCH 06/12] Update linter-and-tests.yml --- .github/workflows/linter-and-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linter-and-tests.yml b/.github/workflows/linter-and-tests.yml index 5665d8da5..b15a3d238 100644 --- a/.github/workflows/linter-and-tests.yml +++ b/.github/workflows/linter-and-tests.yml @@ -4,8 +4,7 @@ on: push: branches: - main - - transfer-test - - test-transfer + - transfer_test jobs: black-formatting: From 06b66bfd9d924a4eead03ead78fba190beefc727 Mon Sep 17 00:00:00 2001 From: amimas Date: Tue, 2 Jan 2024 00:59:58 -0500 Subject: [PATCH 07/12] Update test_transfer_project.py --- tests/acceptance/standard/test_transfer_project.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/standard/test_transfer_project.py b/tests/acceptance/standard/test_transfer_project.py index effc3dad3..601d7af4b 100644 --- a/tests/acceptance/standard/test_transfer_project.py +++ b/tests/acceptance/standard/test_transfer_project.py @@ -12,7 +12,9 @@ class TestTransferProject: def test__transfer_between_two_root_groups( self, project_for_function, group, other_group ): - project_new_path_with_namespace = f"{other_group.path}/{project_for_function.name}" + project_new_path_with_namespace = ( + f"{other_group.path}/{project_for_function.name}" + ) projects_in_destination_before_transfer = other_group.projects.list() config = f""" From 6922402c31c802106e10668e9e23347c4a30416d Mon Sep 17 00:00:00 2001 From: amimas Date: Tue, 2 Jan 2024 01:09:00 -0500 Subject: [PATCH 08/12] Update pr-linter-and-tests.yml --- .github/workflows/pr-linter-and-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-linter-and-tests.yml b/.github/workflows/pr-linter-and-tests.yml index 61598ba67..d2ca4d091 100644 --- a/.github/workflows/pr-linter-and-tests.yml +++ b/.github/workflows/pr-linter-and-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Black Code Formatter uses: gdubicki/black-action@main with: - args: ". --diff" + args: ". --check" types: runs-on: ubuntu-latest From f0473040003eea50cd545e2d832340dbeca6bfea Mon Sep 17 00:00:00 2001 From: amimas Date: Tue, 2 Jan 2024 01:09:55 -0500 Subject: [PATCH 09/12] Update linter-and-tests.yml --- .github/workflows/linter-and-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter-and-tests.yml b/.github/workflows/linter-and-tests.yml index b15a3d238..95e99171d 100644 --- a/.github/workflows/linter-and-tests.yml +++ b/.github/workflows/linter-and-tests.yml @@ -15,7 +15,7 @@ jobs: - name: Black Code Formatter uses: gdubicki/black-action@main with: - args: ". --check" + args: ". --diff" types: runs-on: ubuntu-latest From a20f451850c6bc6f958dc3e124de558d25588feb Mon Sep 17 00:00:00 2001 From: amimas Date: Tue, 2 Jan 2024 01:27:55 -0500 Subject: [PATCH 10/12] Update test_transfer_project.py --- tests/acceptance/standard/test_transfer_project.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/standard/test_transfer_project.py b/tests/acceptance/standard/test_transfer_project.py index 601d7af4b..98b08e93e 100644 --- a/tests/acceptance/standard/test_transfer_project.py +++ b/tests/acceptance/standard/test_transfer_project.py @@ -102,7 +102,9 @@ def test__transfer_between_root_group_and_subgroup( def test__transfer_as_same_path_at_namespae_already_exist( self, project_for_function, group, other_group ): - project_new_path_with_namespace = f"{other_group.path}/{project_for_function.name}" + project_new_path_with_namespace = ( + f"{other_group.path}/{project_for_function.name}" + ) projects_in_destination_before_transfer = other_group.projects.list() config = f""" From d08c755d3bdac8d946a240b1f24e1f535a829815 Mon Sep 17 00:00:00 2001 From: amimas Date: Tue, 2 Jan 2024 03:05:47 -0500 Subject: [PATCH 11/12] Update test_transfer_project.py --- .../standard/test_transfer_project.py | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/tests/acceptance/standard/test_transfer_project.py b/tests/acceptance/standard/test_transfer_project.py index 98b08e93e..526df32d8 100644 --- a/tests/acceptance/standard/test_transfer_project.py +++ b/tests/acceptance/standard/test_transfer_project.py @@ -32,28 +32,6 @@ def test__transfer_between_two_root_groups( == len(projects_in_destination_before_transfer) + 1 ) - # Now test the transfer the opposite direction by transferring the same project back to the original group - # Transferring the project to the original location also helps because the fixtures used in this test is shared - # with other tests and they will need the fixture in its original form. - # project_new_path_with_namespace = f"{group.path}/{project_for_function.name}" - # project_source = f"{other_group.path}/{project_for_function.name}" - # projects_in_destination_before_transfer = group.projects.list() - - # config = f""" - # projects_and_groups: - # {project_new_path_with_namespace}: - # project: - # transfer_from: {project_source} - # """ - - # run_gitlabform(config, project_new_path_with_namespace) - # projects_in_destination_after_transfer = group.projects.list() - - # assert ( - # len(projects_in_destination_after_transfer) - # == len(projects_in_destination_before_transfer) + 1 - # ) - def test__transfer_between_root_group_and_subgroup( self, project_in_subgroup, group, subgroup ): @@ -75,30 +53,6 @@ def test__transfer_between_root_group_and_subgroup( == len(projects_in_destination_before_transfer) + 1 ) - # Now test the transfer the opposite direction by transferring the same project back to the original group - # Transferring the project to the original location also helps because the fixtures used in this test is shared - # with other tests and they will need the fixture in its original form. - # project_new_path_with_namespace = ( - # f"{group.path}/{subgroup.path}/{project_in_subgroup.name}" - # ) - # project_source = f"{group.path}/{project_in_subgroup.name}" - # projects_in_destination_before_transfer = subgroup.projects.list() - - # config = f""" - # projects_and_groups: - # {project_new_path_with_namespace}: - # project: - # transfer_from: {project_source} - # """ - - # run_gitlabform(config, project_new_path_with_namespace) - # projects_in_destination_after_transfer = subgroup.projects.list() - - # assert ( - # len(projects_in_destination_after_transfer) - # == len(projects_in_destination_before_transfer) + 1 - # ) - def test__transfer_as_same_path_at_namespae_already_exist( self, project_for_function, group, other_group ): From 987c707bbe68635bfe091837ef07cc7386476b65 Mon Sep 17 00:00:00 2001 From: amimas Date: Tue, 2 Jan 2024 03:44:19 -0500 Subject: [PATCH 12/12] Update linter-and-tests.yml --- .github/workflows/linter-and-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linter-and-tests.yml b/.github/workflows/linter-and-tests.yml index 95e99171d..492d78864 100644 --- a/.github/workflows/linter-and-tests.yml +++ b/.github/workflows/linter-and-tests.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - transfer_test jobs: black-formatting: @@ -15,7 +14,7 @@ jobs: - name: Black Code Formatter uses: gdubicki/black-action@main with: - args: ". --diff" + args: ". --check" types: runs-on: ubuntu-latest