-
Notifications
You must be signed in to change notification settings - Fork 38
Add export-pkg support for art:build-info create command #201
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
Changes from 4 commits
4d84c8c
e67c5ca
dcf1617
f236ffb
21b0fef
70e23ac
8ec2228
2d82159
7780b9b
74eb2b1
b6796b9
ed8d318
1ac8e74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,3 +157,36 @@ def package_info(self): | |
| # Check libb package now has the meson dependency | ||
| build_info["modules"][3]["dependencies"] | ||
| assert len(build_info["modules"][3]["dependencies"]) == 2 | ||
|
|
||
|
|
||
| def test_export_pkg(): | ||
|
danimtb marked this conversation as resolved.
Outdated
|
||
| """ | ||
| Test build info created with export-pkg command | ||
| """ | ||
| run("conan new header_lib -d name=lib1 -d version=1.0") | ||
| run("conan create .") | ||
|
|
||
| run("conan new cmake_lib -d name=lib2 -d version=1.0 -d requires=lib1/1.0 --force") | ||
| run("conan build .") | ||
| run("conan export-pkg . --test-folder= -f json > export_pkg.json") | ||
| run("conan upload lib* -c -r conancenter --dry-run") # To generate the .tgz files in conan local cache | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More a question for the client: Isn't it possible to pass an empty remote or not add the argument for a dry-run? (I guess it's not but maybe it should be possible?) passing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not possible, the |
||
|
|
||
| run("conan art:build-info create export_pkg.json build_name 1 repo --with-dependencies --add-cached-deps > bi.json") | ||
| build_info = json.loads(load("bi.json")) | ||
| assert len(build_info["modules"]) == 4 | ||
|
|
||
|
|
||
| def test_simple_create(): | ||
| """ | ||
| Test build info created with simple conan create command to verify same output as the export-pkg command | ||
| """ | ||
| run("conan new header_lib -d name=lib1 -d version=1.0") | ||
| run("conan create .") | ||
|
|
||
| run("conan new cmake_lib -d name=lib2 -d version=1.0 -d requires=lib1/1.0 --force") | ||
| run("conan create . -f json > create.json") | ||
| run("conan upload lib* -c -r conancenter --dry-run") # To generate the .tgz files in conan local cache | ||
|
|
||
| run("conan art:build-info create create.json build_name 1 repo --with-dependencies --add-cached-deps > bi.json") | ||
| build_info = json.loads(load("bi.json")) | ||
| assert len(build_info["modules"]) == 4 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the package folder is ok in both conan create/install and export-pkg graphs, however for the re recipe_folder, in the export-pkg graph the path points to the user local folder, so here I resorted to query the conan cache to get the recipe path in the cache