conda-forge.github.io icon indicating copy to clipboard operation
conda-forge.github.io copied to clipboard

Document that `test/commands` and `run_test.{sh,bat}` cannot coexist

Open leofang opened this issue 3 years ago • 10 comments

As title. If meta.yaml has the test/commands session

test:
  commands:
    - ...

but run_test.{sh,bat} is also provided, the commands in test/commands will not be run. Workarounds include

  • Move all commands to run_test.{sh,bat} (or vice versa)
  • Rename run_test.{sh,bat} to something else and run it explicitly

leofang avatar Aug 11 '21 18:08 leofang

Hi @leofang, thanks for writing an informative description of this issue. I am taking this up.

@kathatherine and @leofang, I am thinking of putting it under this section as a note. What are your thoughts on this?

ssurbhi560 avatar Apr 12 '22 23:04 ssurbhi560

It might be better to put this in the Conda docs. That said, am not sure this is (still?) true. In particular please see this discussion thread for context ( https://github.com/conda-forge/boost-cpp-feedstock/pull/123#discussion_r848854342 )

Edit: It looks like Conda-Build originally starting handling appending the test/commands to the shell script in this commit ( https://github.com/conda/conda-build/commit/555aae2632ea8816b02b25dd60db2fa4339c3dd6 ). Similar logic still exists in Conda-Build.

jakirkham avatar Apr 12 '22 23:04 jakirkham

@leofang do you recall where this came up? No worries if not. Wondering if there might be a bug actually.

jakirkham avatar Apr 12 '22 23:04 jakirkham

Sorry I don't remember in which feedstock I hit the issue, but I seem to remember confirming it's a known issue with either @jaimergp or @beckermr on the Gitter channel back then before filing an issue.

leofang avatar Apr 13 '22 00:04 leofang

I don't recall this one but conda build does have its quirks. Probably need a simple test case here.

beckermr avatar Apr 13 '22 01:04 beckermr

Well we just recently used this with boost-cpp and it does seem to work there. Please see PR ( https://github.com/conda-forge/boost-cpp-feedstock/pull/123 ).

That said, have no problem believing there are other cases where it may have run into issues. Just don't know what those might be.

jakirkham avatar Apr 13 '22 03:04 jakirkham

So I think part of the issue is not much output is produced from run_test.* by default. Filed issue ( https://github.com/conda/conda-build/issues/4426 ) about addressing this.

That said, there may be more to the story. Still digging in 👷

jakirkham avatar Apr 13 '22 04:04 jakirkham

Ok it does look like there is another bug, which is causing this issue. Filed as issue ( https://github.com/conda/conda-build/issues/4427 ).

jakirkham avatar Apr 13 '22 05:04 jakirkham

I think I saw this in the conda-feedstock. https://github.com/conda-forge/conda-feedstock/pull/162

jaimergp avatar Apr 14 '22 09:04 jaimergp

Yeah have a few reproducers now. Tried submitting a fix upstream. Could use a review if you have time to look 🙂

jakirkham avatar Apr 14 '22 15:04 jakirkham