8000 #361 Upload package with revisions by uilianries · Pull Request #363 · conan-io/conan-package-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

#361 Upload package with revisions #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpt/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from conans import tools, __version__ as client_version
from conans.model.version import Version
from conans.model.ref import ConanFileReference

from cpt import __version__ as package_tools_version
from cpt.config import ConfigManager
Expand Down Expand Up @@ -113,6 +114,8 @@ def run(self):
return
for installed in r['installed']:
reference = installed["recipe"]["id"]
if client_version >= Version("1.10.0"):
reference = str(ConanFileReference.loads(installed["recipe"]["id"]).copy_clear_rev())
if ((reference == str(self._reference)) or \
(reference in self._upload_dependencies) or \
("all" in self._upload_dependencies)) and \
Expand Down
27 changes: 23 additions & 4 deletions cpt/test/test_client/upload_checks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_upload_only_recipe_env_var(self):
# Upload only the recipe
with environment_append({"CONAN_UPLOAD": ts.fake_url, "CONAN_LOGIN_USERNAME": "user",
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user",
"CONAN_UPLOAD_ONLY_RECIPE": "TRUE"}):
"CONAN_UPLOAD_ONLY_RECIPE": "TRUE", "CONAN_CHANNEL": "mychannel"}):
mulitpackager = get_patched_multipackager(tc, exclude_vcvars_precommand=True)
mulitpackager.add({}, {"shared": True})
mulitpackager.add({}, {"shared": False})
Expand All @@ -125,7 +125,7 @@ def test_upload_only_recipe_env_var(self):
# Re-use cache the upload the binary packages
with environment_append({"CONAN_UPLOAD": ts.fake_url, "CONAN_LOGIN_USERNAME": "user",
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user",
"CONAN_UPLOAD_ONLY_RECIPE": "FALSE"}):
"CONAN_UPLOAD_ONLY_RECIPE": "FALSE", "CONAN_CHANNEL": "mychannel"}):
mulitpackager = get_patched_multipackager(tc, exclude_vcvars_precommand=True)
mulitpackager.add({}, {"shared": True})
mulitpackager.add({}, {"shared": False})
Expand All @@ -144,7 +144,8 @@ def test_upload_only_recipe_params(self):

# Upload only the recipe
with environment_append({"CONAN_UPLOAD": ts.fake_url, "CONAN_LOGIN_USERNAME": "user",
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user"}):
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user",
"CONAN_CHANNEL": "mychannel"}):
mulitpackager = get_patched_multipackager(tc, exclude_vcvars_precommand=True,
upload_only_recipe=True)
mulitpackager.add({}, {"shared": True})
Expand All @@ -159,7 +160,8 @@ def test_upload_only_recipe_params(self):

# Re-use cache the upload the binary packages
with environment_append({"CONAN_UPLOAD": ts.fake_url, "CONAN_LOGIN_USERNAME": "user",
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user"}):
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user",
"CONAN_CHANNEL": "mychannel"}):
mulitpackager = get_patched_multipackager(tc, exclude_vcvars_precommand=True,
upload_only_recipe=False)
mulitpackager.add({}, {"shared": True})
Expand All @@ -172,6 +174,23 @@ def test_upload_only_recipe_params(self):
self.assertIn("Uploading package 1/2", tc.out)
self.assertIn("Uploading package 2/2", tc.out)

def test_upload_package_revisions(self):
ts = TestServer(users={"user": "password"})
tc = TestClient(servers={"default": ts}, users={"default": [("user", "password")]})
tc.save({"conanfile.py": self.conanfile})
with environment_append({"CONAN_UPLOAD": ts.fake_url, "CONAN_LOGIN_USERNAME": "user",
"CONAN_PASSWORD": "password", "CONAN_USERNAME": "user",
"CONAN_REVISIONS_ENABLED": "1"}):
mulitpackager = get_patched_multipackager(tc, exclude_vcvars_precommand=True)
mulitpackager.add({}, {"shared": True})
mulitpackager.add({}, {"shared": False})
mulitpackager.run()
self.assertNotIn("Skipping upload for 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9", tc.out)
self.assertNotIn("Skipping upload for 2a623e3082a38f90cd2c3d12081161412de331b0", tc.out)
self.assertIn("Uploading package 1/2", tc.out)
self.assertIn("Uploading package 2/2", tc.out)
self.assertIn("HALLO", tc.out)

class UploadDependenciesTest(unittest.TestCase):

conanfile_bar = """from conans import ConanFile
Expand Down
0