Skip to content
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

fix: Correct test #11573

Closed

Conversation

gabyx
Copy link

@gabyx gabyx commented Jul 5, 2022

Changelog: (Bugfix): Fix the test TestConanFileSubfolder which should actually fail.

Issue: #11275

This test should be written like this, and will fail because the bug is not yet fixed.
(if its a bug)

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new failing test (it could start from a copy & paste of this one, then doing the changes), instead of modifying the existing one. But in general we don't change green passing tests, unless there were bugs in the test themselves, are result of other minor unrelated changes (changes in the stdout), or things like that.

Then also please have a look to the comments, I'd say there are some inconsistencies in the definition of the folder locations.

@@ -474,40 +474,41 @@ class Pkg(ConanFile):
version = "0.1"

def export(self):
git = Git(self, os.path.dirname(self.recipe_folder))
git = Git(self, self.recipe_folder)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But your git repo is not the folder in which the conanfile.py lives, it is the parent folder. So the os.path.dirname() is necessary to use the Git repo folder.

url, commit = git.get_url_and_commit()
# We store the current url and commit in conandata.yml
update_conandata(self, {"sources": {"commit": commit, "url": url}})
self.output.info("URL: {}".format(url))
self.output.info("COMMIT: {}".format(commit))

def layout(self):
pass # self.folders.source = "source"
self.folders.source = "project"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if not the source folder would be ., not project (as project only happens if the repo folder is the parent one)

@memsharded memsharded added this to the 1.51 milestone Jul 5, 2022
@memsharded
Copy link
Member

This PR seems related too: #11556

@memsharded
Copy link
Member

Hi @gabyx

This was assigned for 1.51, but we didn't get any response, so I am moving it to next iteration 1.52. Please check the above comments and let us know.

@memsharded memsharded modified the milestones: 1.51, 1.52 Jul 27, 2022
@gabyx
Copy link
Author

gabyx commented Jul 27, 2022

@memsharded: Thanks, jeah I did not have time yet but I hope I can move the test.

@memsharded memsharded modified the milestones: 1.52, 1.53 Aug 29, 2022
@czoido czoido modified the milestones: 1.53, 1.54 Sep 23, 2022
@memsharded
Copy link
Member

Hi @gabyx

This PR has been stale for a few months now, we have been moving it from release to release, I hope it is not an issue anymore, so I am closing it, many thanks for contributing!
If you would like to re-open please do, and please have a look to the comments, specially the one to not change existing passing tests, but add new tests that capture the desired behavior.

@memsharded memsharded closed this Oct 28, 2022
@czoido czoido removed this from the 1.54 milestone Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants