-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature conan cache check-integrity (#13502)
* feature conan cache check-integrity * Update conan/cli/commands/cache.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> * Update conan/cli/commands/cache.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> --------- Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
- Loading branch information
1 parent
ff6b185
commit f7e0369
Showing
3 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
conans/test/integration/command_v2/test_cache_integrity.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
|
||
from conans.test.assets.genconanfile import GenConanfile | ||
from conans.test.utils.tools import TestClient | ||
from conans.util.files import save | ||
|
||
|
||
def test_cache_integrity(): | ||
t = TestClient() | ||
t.save({"conanfile.py": GenConanfile()}) | ||
t.run("create . --name pkg1 --version 1.0") | ||
t.run("create . --name pkg2 --version=2.0") | ||
pref = t.created_package_reference("pkg2/2.0") | ||
layout = t.get_latest_pkg_layout(pref) | ||
conaninfo = os.path.join(layout.package(), "conaninfo.txt") | ||
save(conaninfo, "[settings]") | ||
t.run("create . --name pkg3 --version=3.0") | ||
pref = t.created_package_reference("pkg3/3.0") | ||
layout = t.get_latest_pkg_layout(pref) | ||
conaninfo = os.path.join(layout.package(), "conaninfo.txt") | ||
save(conaninfo, "[settings]") | ||
|
||
t.run("cache check-integrity *", assert_error=True) | ||
assert "pkg1/1.0: Integrity checked: ok" in t.out | ||
assert "pkg1/1.0:da39a3ee5e6b4b0d3255bfef95601890afd80709: Integrity checked: ok" in t.out | ||
assert "ERROR: pkg2/2.0:da39a3ee5e6b4b0d3255bfef95601890afd80709: Manifest mismatch" in t.out | ||
assert "ERROR: pkg3/3.0:da39a3ee5e6b4b0d3255bfef95601890afd80709: Manifest mismatch" in t.out | ||
|