From fabe36c35705996b9c0ed42131dd440aadbfa972 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Fri, 21 Dec 2018 11:12:11 +0100 Subject: [PATCH 1/8] add test manifesting bug --- conans/test/functional/scm_folder/__init__.py | 0 .../functional/scm_folder/obsolete_test.py | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 conans/test/functional/scm_folder/__init__.py create mode 100644 conans/test/functional/scm_folder/obsolete_test.py diff --git a/conans/test/functional/scm_folder/__init__.py b/conans/test/functional/scm_folder/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/conans/test/functional/scm_folder/obsolete_test.py b/conans/test/functional/scm_folder/obsolete_test.py new file mode 100644 index 00000000000..9b6fd990b13 --- /dev/null +++ b/conans/test/functional/scm_folder/obsolete_test.py @@ -0,0 +1,52 @@ +# coding=utf-8 + +import textwrap +import unittest + +from conans.test.utils.tools import TestClient, create_local_git_repo + + +class SCMFolderObsoleteTest(unittest.TestCase): + conanfile = textwrap.dedent("""\ + from conans import ConanFile, tools + + class Pkg(ConanFile): + scm = {"type": "git", + "url": "auto", + "revision": "auto"} + + def build(self): + content = tools.load("file.txt") + self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, + self.user, self.channel)) + self.output.info(">>>> content: {} ".format(content)) + """) + + def test_obsolete(self): + reference = "pkg/v1@user/channel" + t = TestClient(path_with_spaces=False) + + # Create pkg/v1 + create_local_git_repo(files={'conanfile.py': self.conanfile, + 'file.txt': reference}, + folder=t.current_folder) + t.runner('git remote add origin https://myrepo.com.git', cwd=t.current_folder) + t.run("create . {}".format(reference)) + self.assertIn(">>>> I'm {}".format(reference), t.out) + self.assertIn(">>>> content: {}".format(reference), t.out) + + # Work on pkg to improve it ==> create pkg/v2 + ref_v2 = "pkg/v2@user/channel" + t.save(files={'conanfile.py': self.conanfile, + 'file.txt': ref_v2}) + t.runner('git commit -m "up to v2"', cwd=t.current_folder) + t.run("create . {}".format(ref_v2)) + self.assertIn(">>>> I'm {}".format(ref_v2), t.out) + self.assertIn(">>>> content: {}".format(ref_v2), t.out) + + # Now, a consumer wants the pkg/v1 and builds it... + t.run("install {} --build".format(reference)) + self.assertIn(">>>> I'm {}".format(reference), t.out) + self.assertIn(">>>> content: {}".format(reference), t.out) + + From 1cb920091161bff0fe23b8f7bdbd0dc90b066878 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Fri, 21 Dec 2018 18:45:22 +0100 Subject: [PATCH 2/8] add tests related to SVN mono-repo --- .../functional/scm_folder/obsolete_test.py | 4 +- .../functional/scm_folder/svn_checkout.py | 86 +++++++++++++++++++ 2 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 conans/test/functional/scm_folder/svn_checkout.py diff --git a/conans/test/functional/scm_folder/obsolete_test.py b/conans/test/functional/scm_folder/obsolete_test.py index 9b6fd990b13..b6f768d23bc 100644 --- a/conans/test/functional/scm_folder/obsolete_test.py +++ b/conans/test/functional/scm_folder/obsolete_test.py @@ -38,7 +38,7 @@ def test_obsolete(self): # Work on pkg to improve it ==> create pkg/v2 ref_v2 = "pkg/v2@user/channel" t.save(files={'conanfile.py': self.conanfile, - 'file.txt': ref_v2}) + 'file.txt': ref_v2}) t.runner('git commit -m "up to v2"', cwd=t.current_folder) t.run("create . {}".format(ref_v2)) self.assertIn(">>>> I'm {}".format(ref_v2), t.out) @@ -48,5 +48,3 @@ def test_obsolete(self): t.run("install {} --build".format(reference)) self.assertIn(">>>> I'm {}".format(reference), t.out) self.assertIn(">>>> content: {}".format(reference), t.out) - - diff --git a/conans/test/functional/scm_folder/svn_checkout.py b/conans/test/functional/scm_folder/svn_checkout.py new file mode 100644 index 00000000000..2f19e720790 --- /dev/null +++ b/conans/test/functional/scm_folder/svn_checkout.py @@ -0,0 +1,86 @@ +# coding=utf-8 + +import os +import textwrap + +from parameterized import parameterized + +from conans.client.tools import environment_append +from conans.test.utils.tools import SVNLocalRepoTestCase +from conans.test.utils.tools import TestClient + + +class SCMFolderSVNCheckout(SVNLocalRepoTestCase): + conanfile = textwrap.dedent("""\ + import os + from conans import ConanFile, tools + + class Pkg(ConanFile): + scm = {"type": "svn", + "url": "auto", + "revision": "auto"} + + def build(self): + content = tools.load(os.path.join(self.source_folder, "file.txt")) + self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, + self.user, self.channel)) + self.output.info(">>>> content: {} ".format(content)) + """) + + def setUp(self): + self.lib1_ref = "lib1/version@user/channel" + self.lib2_ref = "lib2/version@user/channel" + self.url, rev = self.create_project(files={'lib1/conanfile.py': self.conanfile, + 'lib1/file.txt': self.lib1_ref}) + + @parameterized.expand([(True, ), (False, )]) + def test_local_workflow_root_folder(self, use_monorepo): + url_suffix = "" if use_monorepo else "/lib1" + path_to_lib = "lib1" if use_monorepo else "." + + t = TestClient(path_with_spaces=False) + t.runner("svn co {}{} .".format(self.url, url_suffix), cwd=t.current_folder) + + with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from root folder) + t.run("install {} -if tmp".format(path_to_lib)) + t.run("source {} -if tmp -sf src".format(path_to_lib)) + t.run("build {} -if tmp -sf src -bf build".format(path_to_lib)) + self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + + + @parameterized.expand([(True,), (False,)]) + def test_local_workflow_inner_folder(self, use_monorepo): + url_suffix = "" if use_monorepo else "/lib1" + path_to_lib = "lib1" if use_monorepo else "." + + t = TestClient(path_with_spaces=False) + t.runner("svn co {}{} .".format(self.url, url_suffix), cwd=t.current_folder) + + with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from inner folder) + lib1_path = os.path.join(t.current_folder, path_to_lib) + try: + old_path = t.current_folder + t.current_folder = lib1_path + t.run("install . -if tmp", ) + t.run("source . -if tmp -sf src") + t.run("build . -if tmp -sf src -bf build") + self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + finally: + t.current_folder = old_path + + @parameterized.expand([(True,), (False,)]) + def test_remote_workflow(self, use_monorepo): + url_suffix = "" if use_monorepo else "/lib1" + path_to_lib = "lib1" if use_monorepo else "." + + t = TestClient(path_with_spaces=False) + t.runner("svn co {}{} .".format(self.url, url_suffix), cwd=t.current_folder) + + # Remote workflow + t.run("create {} {}".format(path_to_lib, self.lib1_ref)) + self.assertIn(">>>> I'm {}".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) From dfe45dd70030ff758fc9deb8938e9df94e7ac106 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Fri, 21 Dec 2018 18:46:16 +0100 Subject: [PATCH 3/8] minor fix --- conans/test/functional/scm_folder/svn_checkout.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conans/test/functional/scm_folder/svn_checkout.py b/conans/test/functional/scm_folder/svn_checkout.py index 2f19e720790..4e5b9d5469e 100644 --- a/conans/test/functional/scm_folder/svn_checkout.py +++ b/conans/test/functional/scm_folder/svn_checkout.py @@ -30,8 +30,8 @@ def build(self): def setUp(self): self.lib1_ref = "lib1/version@user/channel" self.lib2_ref = "lib2/version@user/channel" - self.url, rev = self.create_project(files={'lib1/conanfile.py': self.conanfile, - 'lib1/file.txt': self.lib1_ref}) + self.url, _ = self.create_project(files={'lib1/conanfile.py': self.conanfile, + 'lib1/file.txt': self.lib1_ref}) @parameterized.expand([(True, ), (False, )]) def test_local_workflow_root_folder(self, use_monorepo): @@ -61,8 +61,8 @@ def test_local_workflow_inner_folder(self, use_monorepo): with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): # Local workflow (from inner folder) lib1_path = os.path.join(t.current_folder, path_to_lib) + old_path = t.current_folder try: - old_path = t.current_folder t.current_folder = lib1_path t.run("install . -if tmp", ) t.run("source . -if tmp -sf src") From 7def39b5341e7c935a73776d91dc07a3c88e53cb Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Fri, 21 Dec 2018 19:10:21 +0100 Subject: [PATCH 4/8] modify tests --- .../functional/scm_folder/git_checkout.py | 74 +++++++++++++++++++ .../functional/scm_folder/obsolete_test.py | 6 +- 2 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 conans/test/functional/scm_folder/git_checkout.py diff --git a/conans/test/functional/scm_folder/git_checkout.py b/conans/test/functional/scm_folder/git_checkout.py new file mode 100644 index 00000000000..eaab307e2ad --- /dev/null +++ b/conans/test/functional/scm_folder/git_checkout.py @@ -0,0 +1,74 @@ +# coding=utf-8 + +import os +import textwrap + +from parameterized import parameterized + +from conans.client.tools import environment_append +from conans.test.utils.tools import SVNLocalRepoTestCase +from conans.test.utils.tools import TestClient, create_local_git_repo + + +class SCMFolderGITCheckout(SVNLocalRepoTestCase): + conanfile = textwrap.dedent("""\ + import os + from conans import ConanFile, tools + + class Pkg(ConanFile): + scm = {"type": "git", + "url": "auto", + "revision": "auto"} + + def build(self): + content = tools.load(os.path.join(self.source_folder, "file.txt")) + self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, + self.user, self.channel)) + self.output.info(">>>> content: {} ".format(content)) + """) + + def setUp(self): + self.lib1_ref = "lib1/version@user/channel" + self.lib2_ref = "lib2/version@user/channel" + self.url, _ = create_local_git_repo(files={'lib1/conanfile.py': self.conanfile, + 'lib1/file.txt': self.lib1_ref}) + + def test_local_workflow_root_folder(self): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + t.runner("ls -la", cwd=t.current_folder) + + with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from root folder) + t.run("install lib1 -if tmp") + t.run("source lib1 -if tmp -sf src") + t.run("build lib1 -if tmp -sf src -bf build") + self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + + def test_local_workflow_inner_folder(self): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + + with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from inner folder) + lib1_path = os.path.join(t.current_folder, "lib1") + old_path = t.current_folder + try: + t.current_folder = lib1_path + t.run("install . -if tmp", ) + t.run("source . -if tmp -sf src") + t.run("build . -if tmp -sf src -bf build") + self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + finally: + t.current_folder = old_path + + def test_remote_workflow(self): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + + # Remote workflow + t.run("create lib1 {}".format(self.lib1_ref)) + self.assertIn(">>>> I'm {}".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) diff --git a/conans/test/functional/scm_folder/obsolete_test.py b/conans/test/functional/scm_folder/obsolete_test.py index b6f768d23bc..bc22b333ceb 100644 --- a/conans/test/functional/scm_folder/obsolete_test.py +++ b/conans/test/functional/scm_folder/obsolete_test.py @@ -27,10 +27,10 @@ def test_obsolete(self): t = TestClient(path_with_spaces=False) # Create pkg/v1 - create_local_git_repo(files={'conanfile.py': self.conanfile, + url, _ = create_local_git_repo(files={'conanfile.py': self.conanfile, 'file.txt': reference}, folder=t.current_folder) - t.runner('git remote add origin https://myrepo.com.git', cwd=t.current_folder) + t.runner('git remote add origin {}'.format(url), cwd=t.current_folder) t.run("create . {}".format(reference)) self.assertIn(">>>> I'm {}".format(reference), t.out) self.assertIn(">>>> content: {}".format(reference), t.out) @@ -39,7 +39,7 @@ def test_obsolete(self): ref_v2 = "pkg/v2@user/channel" t.save(files={'conanfile.py': self.conanfile, 'file.txt': ref_v2}) - t.runner('git commit -m "up to v2"', cwd=t.current_folder) + t.runner('git commit -a -m "up to v2"', cwd=t.current_folder) t.run("create . {}".format(ref_v2)) self.assertIn(">>>> I'm {}".format(ref_v2), t.out) self.assertIn(">>>> content: {}".format(ref_v2), t.out) From 780b9251e2c61d601225646c89e152fe183947cd Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Mon, 24 Dec 2018 09:10:09 +0100 Subject: [PATCH 5/8] preparing tests for several use cases of SCM --- conans/client/cmd/export.py | 10 +- .../functional/scm_folder/git_checkout.py | 74 ------------ .../scm_folder/git_checkout_test.py | 95 +++++++++++++++ .../functional/scm_folder/obsolete_test.py | 56 +++++---- .../functional/scm_folder/svn_checkout.py | 86 -------------- .../scm_folder/svn_checkout_test.py | 112 ++++++++++++++++++ 6 files changed, 243 insertions(+), 190 deletions(-) delete mode 100644 conans/test/functional/scm_folder/git_checkout.py create mode 100644 conans/test/functional/scm_folder/git_checkout_test.py delete mode 100644 conans/test/functional/scm_folder/svn_checkout.py create mode 100644 conans/test/functional/scm_folder/svn_checkout_test.py diff --git a/conans/client/cmd/export.py b/conans/client/cmd/export.py index ad784901090..87ff30d4503 100644 --- a/conans/client/cmd/export.py +++ b/conans/client/cmd/export.py @@ -14,6 +14,7 @@ from conans.search.search import search_recipes from conans.util.files import is_dirty, load, mkdir, rmdir, save, set_dirty from conans.util.log import logger +from conans.util.config_parser import get_bool_from_text def export_alias(reference, target_reference, client_cache): @@ -76,10 +77,11 @@ def _capture_export_scm_data(conanfile, conanfile_dir, destination_folder, outpu captured_revision = scm_data.capture_revision scm = SCM(scm_data, conanfile_dir, output) - if scm_data.capture_origin or scm_data.capture_revision: - # Generate the scm_folder.txt file pointing to the src_path - src_path = scm.get_repo_root() - save(scm_src_file, src_path.replace("\\", "/")) + if get_bool_from_text(os.environ.get("USE_SCM_FOLER", "True")): + if scm_data.capture_origin or scm_data.capture_revision: + # Generate the scm_folder.txt file pointing to the src_path + src_path = scm.get_repo_root() + save(scm_src_file, src_path.replace("\\", "/")) if scm_data.url == "auto": origin = scm.get_qualified_remote_url() diff --git a/conans/test/functional/scm_folder/git_checkout.py b/conans/test/functional/scm_folder/git_checkout.py deleted file mode 100644 index eaab307e2ad..00000000000 --- a/conans/test/functional/scm_folder/git_checkout.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 - -import os -import textwrap - -from parameterized import parameterized - -from conans.client.tools import environment_append -from conans.test.utils.tools import SVNLocalRepoTestCase -from conans.test.utils.tools import TestClient, create_local_git_repo - - -class SCMFolderGITCheckout(SVNLocalRepoTestCase): - conanfile = textwrap.dedent("""\ - import os - from conans import ConanFile, tools - - class Pkg(ConanFile): - scm = {"type": "git", - "url": "auto", - "revision": "auto"} - - def build(self): - content = tools.load(os.path.join(self.source_folder, "file.txt")) - self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, - self.user, self.channel)) - self.output.info(">>>> content: {} ".format(content)) - """) - - def setUp(self): - self.lib1_ref = "lib1/version@user/channel" - self.lib2_ref = "lib2/version@user/channel" - self.url, _ = create_local_git_repo(files={'lib1/conanfile.py': self.conanfile, - 'lib1/file.txt': self.lib1_ref}) - - def test_local_workflow_root_folder(self): - t = TestClient(path_with_spaces=False) - t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) - t.runner("ls -la", cwd=t.current_folder) - - with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): - # Local workflow (from root folder) - t.run("install lib1 -if tmp") - t.run("source lib1 -if tmp -sf src") - t.run("build lib1 -if tmp -sf src -bf build") - self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) - self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) - - def test_local_workflow_inner_folder(self): - t = TestClient(path_with_spaces=False) - t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) - - with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): - # Local workflow (from inner folder) - lib1_path = os.path.join(t.current_folder, "lib1") - old_path = t.current_folder - try: - t.current_folder = lib1_path - t.run("install . -if tmp", ) - t.run("source . -if tmp -sf src") - t.run("build . -if tmp -sf src -bf build") - self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) - self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) - finally: - t.current_folder = old_path - - def test_remote_workflow(self): - t = TestClient(path_with_spaces=False) - t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) - - # Remote workflow - t.run("create lib1 {}".format(self.lib1_ref)) - self.assertIn(">>>> I'm {}".format(self.lib1_ref), t.out) - self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) diff --git a/conans/test/functional/scm_folder/git_checkout_test.py b/conans/test/functional/scm_folder/git_checkout_test.py new file mode 100644 index 00000000000..e160bc9af15 --- /dev/null +++ b/conans/test/functional/scm_folder/git_checkout_test.py @@ -0,0 +1,95 @@ +# coding=utf-8 + +import os +import textwrap +import unittest + +from parameterized import parameterized + +from conans.client.tools import environment_append +from conans.test.utils.tools import TestClient, create_local_git_repo + + +class SCMFolderGITCheckout(unittest.TestCase): + conanfile = textwrap.dedent("""\ + import os + from conans import ConanFile, tools + + class Pkg(ConanFile): + scm = {"type": "git", + "url": "auto", + "revision": "auto"} + + def build(self): + content = tools.load(os.path.join(self.source_folder, "file.txt")) + self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, + self.user, self.channel)) + self.output.info(">>>> content: {} ".format(content)) + """) + + def setUp(self): + self.lib1_ref = "lib1/version@user/channel" + self.url, _ = create_local_git_repo(files={'lib1/conanfile.py': self.conanfile, + 'lib1/file.txt': self.lib1_ref}) + + def _run_local_test(self, t, working_dir, path_to_conanfile): + old_wd = t.current_folder + try: + t.current_folder = working_dir + t.run("install {} -if tmp".format(path_to_conanfile)) + t.run("source {} -if tmp -sf src".format(path_to_conanfile)) + t.run("build {} -if tmp -sf src -bf build".format(path_to_conanfile)) + self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + finally: + t.current_folder = old_wd + + @parameterized.expand([("True",), ("False",)]) + def test_local_workflow_root_folder(self, use_scm_folder): + with environment_append({'USE_SCM_FOLER': use_scm_folder, + 'CONAN_USERNAME': "user", + 'CONAN_CHANNEL': "channel"}): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + + # Local workflow (from root folder) + self._run_local_test(t, t.current_folder, "lib1") + + @parameterized.expand([("True",), ("False",)]) + def test_local_workflow_inner_folder(self, use_scm_folder): + with environment_append({'USE_SCM_FOLER': use_scm_folder, + 'CONAN_USERNAME': "user", + 'CONAN_CHANNEL': "channel"}): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + + # Local workflow (from inner folder) + self._run_local_test(t, os.path.join(t.current_folder, "lib1"), ".") + + def _run_remote_test(self, t, working_dir, path_to_conanfile): + old_wd = t.current_folder + try: + t.current_folder = working_dir + t.run("create {} {}".format(path_to_conanfile, self.lib1_ref)) + self.assertIn(">>>> I'm {}".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + finally: + t.current_folder = old_wd + + @parameterized.expand([("True",), ("False",)]) + def test_remote_workflow(self, use_scm_folder): + with environment_append({"USE_SCM_FOLER": use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + + # Remote workflow + self._run_remote_test(t, t.current_folder, "lib1") + + @parameterized.expand([("True",), ("False",)]) + def test_remote_workflow_chdir(self, use_scm_folder): + with environment_append({"USE_SCM_FOLER": use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) + + # Remote workflow + self._run_remote_test(t, os.path.join(t.current_folder, "lib1"), ".") diff --git a/conans/test/functional/scm_folder/obsolete_test.py b/conans/test/functional/scm_folder/obsolete_test.py index bc22b333ceb..8ad2d9a89ed 100644 --- a/conans/test/functional/scm_folder/obsolete_test.py +++ b/conans/test/functional/scm_folder/obsolete_test.py @@ -3,7 +3,9 @@ import textwrap import unittest +from parameterized import parameterized from conans.test.utils.tools import TestClient, create_local_git_repo +from conans.client.tools import environment_append class SCMFolderObsoleteTest(unittest.TestCase): @@ -22,29 +24,31 @@ def build(self): self.output.info(">>>> content: {} ".format(content)) """) - def test_obsolete(self): - reference = "pkg/v1@user/channel" - t = TestClient(path_with_spaces=False) - - # Create pkg/v1 - url, _ = create_local_git_repo(files={'conanfile.py': self.conanfile, - 'file.txt': reference}, - folder=t.current_folder) - t.runner('git remote add origin {}'.format(url), cwd=t.current_folder) - t.run("create . {}".format(reference)) - self.assertIn(">>>> I'm {}".format(reference), t.out) - self.assertIn(">>>> content: {}".format(reference), t.out) - - # Work on pkg to improve it ==> create pkg/v2 - ref_v2 = "pkg/v2@user/channel" - t.save(files={'conanfile.py': self.conanfile, - 'file.txt': ref_v2}) - t.runner('git commit -a -m "up to v2"', cwd=t.current_folder) - t.run("create . {}".format(ref_v2)) - self.assertIn(">>>> I'm {}".format(ref_v2), t.out) - self.assertIn(">>>> content: {}".format(ref_v2), t.out) - - # Now, a consumer wants the pkg/v1 and builds it... - t.run("install {} --build".format(reference)) - self.assertIn(">>>> I'm {}".format(reference), t.out) - self.assertIn(">>>> content: {}".format(reference), t.out) + @parameterized.expand([("True", ), ("False", )]) + def test_obsolete(self, use_scm_folder): + with environment_append({"USE_SCM_FOLER": use_scm_folder}): + reference = "pkg/v1@user/channel" + t = TestClient(path_with_spaces=False) + + # Create pkg/v1 + url, _ = create_local_git_repo(files={'conanfile.py': self.conanfile, + 'file.txt': reference}, + folder=t.current_folder) + t.runner('git remote add origin {}'.format(url), cwd=t.current_folder) + t.run("create . {}".format(reference)) + self.assertIn(">>>> I'm {}".format(reference), t.out) + self.assertIn(">>>> content: {}".format(reference), t.out) + + # Work on pkg to improve it ==> create pkg/v2 + ref_v2 = "pkg/v2@user/channel" + t.save(files={'conanfile.py': self.conanfile, + 'file.txt': ref_v2}) + t.runner('git commit -a -m "up to v2"', cwd=t.current_folder) + t.run("create . {}".format(ref_v2)) + self.assertIn(">>>> I'm {}".format(ref_v2), t.out) + self.assertIn(">>>> content: {}".format(ref_v2), t.out) + + # Now, a consumer wants the pkg/v1 and builds it... + t.run("install {} --build".format(reference)) + self.assertIn(">>>> I'm {}".format(reference), t.out) + self.assertIn(">>>> content: {}".format(reference), t.out) diff --git a/conans/test/functional/scm_folder/svn_checkout.py b/conans/test/functional/scm_folder/svn_checkout.py deleted file mode 100644 index 4e5b9d5469e..00000000000 --- a/conans/test/functional/scm_folder/svn_checkout.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding=utf-8 - -import os -import textwrap - -from parameterized import parameterized - -from conans.client.tools import environment_append -from conans.test.utils.tools import SVNLocalRepoTestCase -from conans.test.utils.tools import TestClient - - -class SCMFolderSVNCheckout(SVNLocalRepoTestCase): - conanfile = textwrap.dedent("""\ - import os - from conans import ConanFile, tools - - class Pkg(ConanFile): - scm = {"type": "svn", - "url": "auto", - "revision": "auto"} - - def build(self): - content = tools.load(os.path.join(self.source_folder, "file.txt")) - self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, - self.user, self.channel)) - self.output.info(">>>> content: {} ".format(content)) - """) - - def setUp(self): - self.lib1_ref = "lib1/version@user/channel" - self.lib2_ref = "lib2/version@user/channel" - self.url, _ = self.create_project(files={'lib1/conanfile.py': self.conanfile, - 'lib1/file.txt': self.lib1_ref}) - - @parameterized.expand([(True, ), (False, )]) - def test_local_workflow_root_folder(self, use_monorepo): - url_suffix = "" if use_monorepo else "/lib1" - path_to_lib = "lib1" if use_monorepo else "." - - t = TestClient(path_with_spaces=False) - t.runner("svn co {}{} .".format(self.url, url_suffix), cwd=t.current_folder) - - with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): - # Local workflow (from root folder) - t.run("install {} -if tmp".format(path_to_lib)) - t.run("source {} -if tmp -sf src".format(path_to_lib)) - t.run("build {} -if tmp -sf src -bf build".format(path_to_lib)) - self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) - self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) - - - @parameterized.expand([(True,), (False,)]) - def test_local_workflow_inner_folder(self, use_monorepo): - url_suffix = "" if use_monorepo else "/lib1" - path_to_lib = "lib1" if use_monorepo else "." - - t = TestClient(path_with_spaces=False) - t.runner("svn co {}{} .".format(self.url, url_suffix), cwd=t.current_folder) - - with environment_append({'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): - # Local workflow (from inner folder) - lib1_path = os.path.join(t.current_folder, path_to_lib) - old_path = t.current_folder - try: - t.current_folder = lib1_path - t.run("install . -if tmp", ) - t.run("source . -if tmp -sf src") - t.run("build . -if tmp -sf src -bf build") - self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) - self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) - finally: - t.current_folder = old_path - - @parameterized.expand([(True,), (False,)]) - def test_remote_workflow(self, use_monorepo): - url_suffix = "" if use_monorepo else "/lib1" - path_to_lib = "lib1" if use_monorepo else "." - - t = TestClient(path_with_spaces=False) - t.runner("svn co {}{} .".format(self.url, url_suffix), cwd=t.current_folder) - - # Remote workflow - t.run("create {} {}".format(path_to_lib, self.lib1_ref)) - self.assertIn(">>>> I'm {}".format(self.lib1_ref), t.out) - self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) diff --git a/conans/test/functional/scm_folder/svn_checkout_test.py b/conans/test/functional/scm_folder/svn_checkout_test.py new file mode 100644 index 00000000000..cc8cb8de905 --- /dev/null +++ b/conans/test/functional/scm_folder/svn_checkout_test.py @@ -0,0 +1,112 @@ +# coding=utf-8 + +import os +import textwrap +import unittest + +from parameterized import parameterized + +from conans.client.tools import environment_append +from conans.test.utils.tools import SVNLocalRepoTestCase +from conans.test.utils.tools import TestClient + + +@unittest.attr("svn") +class SCMFolderSVNCheckout(SVNLocalRepoTestCase): + conanfile = textwrap.dedent("""\ + import os + from conans import ConanFile, tools + + class Pkg(ConanFile): + scm = {"type": "svn", + "url": "auto", + "revision": "auto"} + + def build(self): + content = tools.load(os.path.join(self.source_folder, "file.txt")) + self.output.info(">>>> I'm {}/{}@{}/{}".format(self.name, self.version, + self.user, self.channel)) + self.output.info(">>>> content: {} ".format(content)) + """) + + def setUp(self): + self.lib1_ref = "lib1/version@user/channel" + self.lib2_ref = "lib2/version@user/channel" + self.url, _ = self.create_project(files={'lib1/conanfile.py': self.conanfile, + 'lib1/file.txt': self.lib1_ref}) + + def _run_local_test(self, t, working_dir, path_to_conanfile): + old_wd = t.current_folder + try: + t.current_folder = working_dir + t.run("install {} -if tmp".format(path_to_conanfile)) + t.run("source {} -if tmp -sf src".format(path_to_conanfile)) + t.run("build {} -if tmp -sf src -bf build".format(path_to_conanfile)) + self.assertIn(">>>> I'm None/None@user/channel".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + finally: + t.current_folder = old_wd + + @parameterized.expand([("True",), ("False",)]) + def test_local_workflow_root_folder(self, use_scm_folder): + t = TestClient(path_with_spaces=False) + t.runner("svn co {}/lib1 .".format(self.url), cwd=t.current_folder) + + with environment_append({'USE_SCM_FOLDER': use_scm_folder, 'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from root folder) + self._run_local_test(t, t.current_folder, ".") + + @parameterized.expand([("True",), ("False",)]) + def test_local_workflow_root_folder_monorepo(self, use_scm_folder): + t = TestClient(path_with_spaces=False) + t.runner("svn co {} .".format(self.url), cwd=t.current_folder) + + with environment_append({'USE_SCM_FOLDER': use_scm_folder, 'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from root folder) + self._run_local_test(t, t.current_folder, "lib1") + + @parameterized.expand([("True",), ("False",)]) + def test_local_workflow_root_folder_monorepo_chdir(self, use_scm_folder): + t = TestClient(path_with_spaces=False) + t.runner("svn co {} .".format(self.url), cwd=t.current_folder) + + with environment_append({'USE_SCM_FOLDER': use_scm_folder, 'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): + # Local workflow (from root folder) + self._run_local_test(t, os.path.join(t.current_folder, "lib1"), ".") + + def _run_remote_test(self, t, working_dir, path_to_conanfile): + old_wd = t.current_folder + try: + t.current_folder = working_dir + t.run("create {} {}".format(path_to_conanfile, self.lib1_ref)) + self.assertIn(">>>> I'm {}".format(self.lib1_ref), t.out) + self.assertIn(">>>> content: {}".format(self.lib1_ref), t.out) + finally: + t.current_folder = old_wd + + @parameterized.expand([("True",), ("False",)]) + def test_remote_workflow(self, use_scm_folder): + with environment_append({"USE_SCM_FOLER": use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner("svn co {}/lib1 .".format(self.url), cwd=t.current_folder) + + # Remote workflow + self._run_remote_test(t, t.current_folder, ".") + + @parameterized.expand([("True",), ("False",)]) + def test_remote_workflow_monorepo(self, use_scm_folder): + with environment_append({"USE_SCM_FOLER": use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner("svn co {} .".format(self.url), cwd=t.current_folder) + + # Remote workflow + self._run_remote_test(t, t.current_folder, "lib1") + + @parameterized.expand([("True",), ("False",)]) + def test_remote_workflow_monorepo_chdir(self, use_scm_folder): + with environment_append({"USE_SCM_FOLER": use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner("svn co {} .".format(self.url), cwd=t.current_folder) + + # Remote workflow + self._run_remote_test(t, os.path.join(t.current_folder, "lib1"), ".") From bb498d1959d4d630507979b9c67a6bd248294b42 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Mon, 24 Dec 2018 09:23:24 +0100 Subject: [PATCH 6/8] centralize env vars --- .../scm_folder/git_checkout_test.py | 19 ++++++------- .../scm_folder/svn_checkout_test.py | 28 +++++++++++-------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/conans/test/functional/scm_folder/git_checkout_test.py b/conans/test/functional/scm_folder/git_checkout_test.py index e160bc9af15..8d8c1b260dd 100644 --- a/conans/test/functional/scm_folder/git_checkout_test.py +++ b/conans/test/functional/scm_folder/git_checkout_test.py @@ -10,7 +10,7 @@ from conans.test.utils.tools import TestClient, create_local_git_repo -class SCMFolderGITCheckout(unittest.TestCase): +class SCMFolderGitTest(unittest.TestCase): conanfile = textwrap.dedent("""\ import os from conans import ConanFile, tools @@ -27,6 +27,11 @@ def build(self): self.output.info(">>>> content: {} ".format(content)) """) + def run(self, *args, **kwargs): + with environment_append({'CONAN_USERNAME': "user", + 'CONAN_CHANNEL': "channel"}): + super(SCMFolderGitTest, self).run(*args, **kwargs) + def setUp(self): self.lib1_ref = "lib1/version@user/channel" self.url, _ = create_local_git_repo(files={'lib1/conanfile.py': self.conanfile, @@ -46,9 +51,7 @@ def _run_local_test(self, t, working_dir, path_to_conanfile): @parameterized.expand([("True",), ("False",)]) def test_local_workflow_root_folder(self, use_scm_folder): - with environment_append({'USE_SCM_FOLER': use_scm_folder, - 'CONAN_USERNAME': "user", - 'CONAN_CHANNEL': "channel"}): + with environment_append({'USE_SCM_FOLER': use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) @@ -57,9 +60,7 @@ def test_local_workflow_root_folder(self, use_scm_folder): @parameterized.expand([("True",), ("False",)]) def test_local_workflow_inner_folder(self, use_scm_folder): - with environment_append({'USE_SCM_FOLER': use_scm_folder, - 'CONAN_USERNAME': "user", - 'CONAN_CHANNEL': "channel"}): + with environment_append({'USE_SCM_FOLER': use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) @@ -81,8 +82,6 @@ def test_remote_workflow(self, use_scm_folder): with environment_append({"USE_SCM_FOLER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) - - # Remote workflow self._run_remote_test(t, t.current_folder, "lib1") @parameterized.expand([("True",), ("False",)]) @@ -90,6 +89,4 @@ def test_remote_workflow_chdir(self, use_scm_folder): with environment_append({"USE_SCM_FOLER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) - - # Remote workflow self._run_remote_test(t, os.path.join(t.current_folder, "lib1"), ".") diff --git a/conans/test/functional/scm_folder/svn_checkout_test.py b/conans/test/functional/scm_folder/svn_checkout_test.py index cc8cb8de905..12192120ef6 100644 --- a/conans/test/functional/scm_folder/svn_checkout_test.py +++ b/conans/test/functional/scm_folder/svn_checkout_test.py @@ -3,6 +3,7 @@ import os import textwrap import unittest +from nose.plugins.attrib import attr from parameterized import parameterized @@ -11,7 +12,7 @@ from conans.test.utils.tools import TestClient -@unittest.attr("svn") +@attr("svn") class SCMFolderSVNCheckout(SVNLocalRepoTestCase): conanfile = textwrap.dedent("""\ import os @@ -29,6 +30,11 @@ def build(self): self.output.info(">>>> content: {} ".format(content)) """) + def run(self, *args, **kwargs): + with environment_append({'CONAN_USERNAME': "user", + "CONAN_CHANNEL": "channel"}): + super(SCMFolderSVNCheckout, self).run(*args, **kwargs) + def setUp(self): self.lib1_ref = "lib1/version@user/channel" self.lib2_ref = "lib2/version@user/channel" @@ -49,29 +55,29 @@ def _run_local_test(self, t, working_dir, path_to_conanfile): @parameterized.expand([("True",), ("False",)]) def test_local_workflow_root_folder(self, use_scm_folder): - t = TestClient(path_with_spaces=False) - t.runner("svn co {}/lib1 .".format(self.url), cwd=t.current_folder) + with environment_append({'USE_SCM_FOLDER': use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner("svn co {}/lib1 .".format(self.url), cwd=t.current_folder) - with environment_append({'USE_SCM_FOLDER': use_scm_folder, 'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): # Local workflow (from root folder) self._run_local_test(t, t.current_folder, ".") @parameterized.expand([("True",), ("False",)]) def test_local_workflow_root_folder_monorepo(self, use_scm_folder): - t = TestClient(path_with_spaces=False) - t.runner("svn co {} .".format(self.url), cwd=t.current_folder) + with environment_append({'USE_SCM_FOLDER': use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner("svn co {} .".format(self.url), cwd=t.current_folder) - with environment_append({'USE_SCM_FOLDER': use_scm_folder, 'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): # Local workflow (from root folder) self._run_local_test(t, t.current_folder, "lib1") @parameterized.expand([("True",), ("False",)]) def test_local_workflow_root_folder_monorepo_chdir(self, use_scm_folder): - t = TestClient(path_with_spaces=False) - t.runner("svn co {} .".format(self.url), cwd=t.current_folder) + with environment_append({'USE_SCM_FOLDER': use_scm_folder}): + t = TestClient(path_with_spaces=False) + t.runner("svn co {} .".format(self.url), cwd=t.current_folder) - with environment_append({'USE_SCM_FOLDER': use_scm_folder, 'CONAN_USERNAME': "user", "CONAN_CHANNEL": "channel"}): - # Local workflow (from root folder) + # Local workflow (from inner folder) self._run_local_test(t, os.path.join(t.current_folder, "lib1"), ".") def _run_remote_test(self, t, working_dir, path_to_conanfile): From a6bc94450d7e522d64370041eaa257d66d4fabbf Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Mon, 24 Dec 2018 09:32:07 +0100 Subject: [PATCH 7/8] order imports --- conans/test/functional/scm_folder/svn_checkout_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conans/test/functional/scm_folder/svn_checkout_test.py b/conans/test/functional/scm_folder/svn_checkout_test.py index 12192120ef6..43f98463e61 100644 --- a/conans/test/functional/scm_folder/svn_checkout_test.py +++ b/conans/test/functional/scm_folder/svn_checkout_test.py @@ -2,9 +2,8 @@ import os import textwrap -import unittest -from nose.plugins.attrib import attr +from nose.plugins.attrib import attr from parameterized import parameterized from conans.client.tools import environment_append From cfccfc3eecca9cf1745b8e4b2445c2cc6b8b6057 Mon Sep 17 00:00:00 2001 From: "Javier G. Sogo" Date: Mon, 24 Dec 2018 12:48:09 +0100 Subject: [PATCH 8/8] typo --- conans/client/cmd/export.py | 2 +- conans/test/functional/scm_folder/git_checkout_test.py | 8 ++++---- conans/test/functional/scm_folder/obsolete_test.py | 2 +- conans/test/functional/scm_folder/svn_checkout_test.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conans/client/cmd/export.py b/conans/client/cmd/export.py index 87ff30d4503..241169cb717 100644 --- a/conans/client/cmd/export.py +++ b/conans/client/cmd/export.py @@ -77,7 +77,7 @@ def _capture_export_scm_data(conanfile, conanfile_dir, destination_folder, outpu captured_revision = scm_data.capture_revision scm = SCM(scm_data, conanfile_dir, output) - if get_bool_from_text(os.environ.get("USE_SCM_FOLER", "True")): + if get_bool_from_text(os.environ.get("USE_SCM_FOLDER", "True")): if scm_data.capture_origin or scm_data.capture_revision: # Generate the scm_folder.txt file pointing to the src_path src_path = scm.get_repo_root() diff --git a/conans/test/functional/scm_folder/git_checkout_test.py b/conans/test/functional/scm_folder/git_checkout_test.py index 8d8c1b260dd..2687d991850 100644 --- a/conans/test/functional/scm_folder/git_checkout_test.py +++ b/conans/test/functional/scm_folder/git_checkout_test.py @@ -51,7 +51,7 @@ def _run_local_test(self, t, working_dir, path_to_conanfile): @parameterized.expand([("True",), ("False",)]) def test_local_workflow_root_folder(self, use_scm_folder): - with environment_append({'USE_SCM_FOLER': use_scm_folder}): + with environment_append({'USE_SCM_FOLDER': use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) @@ -60,7 +60,7 @@ def test_local_workflow_root_folder(self, use_scm_folder): @parameterized.expand([("True",), ("False",)]) def test_local_workflow_inner_folder(self, use_scm_folder): - with environment_append({'USE_SCM_FOLER': use_scm_folder}): + with environment_append({'USE_SCM_FOLDER': use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) @@ -79,14 +79,14 @@ def _run_remote_test(self, t, working_dir, path_to_conanfile): @parameterized.expand([("True",), ("False",)]) def test_remote_workflow(self, use_scm_folder): - with environment_append({"USE_SCM_FOLER": use_scm_folder}): + with environment_append({"USE_SCM_FOLDER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) self._run_remote_test(t, t.current_folder, "lib1") @parameterized.expand([("True",), ("False",)]) def test_remote_workflow_chdir(self, use_scm_folder): - with environment_append({"USE_SCM_FOLER": use_scm_folder}): + with environment_append({"USE_SCM_FOLDER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner('git clone "{}" .'.format(self.url), cwd=t.current_folder) self._run_remote_test(t, os.path.join(t.current_folder, "lib1"), ".") diff --git a/conans/test/functional/scm_folder/obsolete_test.py b/conans/test/functional/scm_folder/obsolete_test.py index 8ad2d9a89ed..41f229fb713 100644 --- a/conans/test/functional/scm_folder/obsolete_test.py +++ b/conans/test/functional/scm_folder/obsolete_test.py @@ -26,7 +26,7 @@ def build(self): @parameterized.expand([("True", ), ("False", )]) def test_obsolete(self, use_scm_folder): - with environment_append({"USE_SCM_FOLER": use_scm_folder}): + with environment_append({"USE_SCM_FOLDER": use_scm_folder}): reference = "pkg/v1@user/channel" t = TestClient(path_with_spaces=False) diff --git a/conans/test/functional/scm_folder/svn_checkout_test.py b/conans/test/functional/scm_folder/svn_checkout_test.py index 43f98463e61..0b9ef3bbec0 100644 --- a/conans/test/functional/scm_folder/svn_checkout_test.py +++ b/conans/test/functional/scm_folder/svn_checkout_test.py @@ -91,7 +91,7 @@ def _run_remote_test(self, t, working_dir, path_to_conanfile): @parameterized.expand([("True",), ("False",)]) def test_remote_workflow(self, use_scm_folder): - with environment_append({"USE_SCM_FOLER": use_scm_folder}): + with environment_append({"USE_SCM_FOLDER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner("svn co {}/lib1 .".format(self.url), cwd=t.current_folder) @@ -100,7 +100,7 @@ def test_remote_workflow(self, use_scm_folder): @parameterized.expand([("True",), ("False",)]) def test_remote_workflow_monorepo(self, use_scm_folder): - with environment_append({"USE_SCM_FOLER": use_scm_folder}): + with environment_append({"USE_SCM_FOLDER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner("svn co {} .".format(self.url), cwd=t.current_folder) @@ -109,7 +109,7 @@ def test_remote_workflow_monorepo(self, use_scm_folder): @parameterized.expand([("True",), ("False",)]) def test_remote_workflow_monorepo_chdir(self, use_scm_folder): - with environment_append({"USE_SCM_FOLER": use_scm_folder}): + with environment_append({"USE_SCM_FOLDER": use_scm_folder}): t = TestClient(path_with_spaces=False) t.runner("svn co {} .".format(self.url), cwd=t.current_folder)