-
Notifications
You must be signed in to change notification settings - Fork 423
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
Exclude test files from tarball #3451
Comments
This is unsupported. You have two options (well maybe 3).
|
@mingwandroid Thanks for the work-around suggestions. I'd also like to understand why |
Because being able to test that a package you built on computer X runs ok on computer X (with all the same temporary, build and host directories around not to mention the same distro/libc/OS version etc) is not nearly as good as being able to test that a package you built on computer X runs on a large range of computers which have never even seen the build environment. Also, the latter includes the former. You can test the tarball on computer X as well.
There is. conda test (there are a few caveats to this but we'll get round to fixing them at some point, namely the dependencies all need to be in the same local channel). Also all of our installers since Anaconda Distribution 5.0 can be passed a -t flag to run the tests embedded in each package in the installers. This is hugely useful for maintaining the quality of our releases. We believe that being able to bundle tests atomically with a package is very powerful, esp. when you are making software that attempts at very broad compatibility. To be clear, when ArchLinux makes a new package, they only need to test it on one Linux distro, once and they are free to assume that, modulus broken end-user hardware, the results would be the same everywhere. We are far from having such a luxury. We were not concerned about package size bloat due to large test data because we have
How is this better? What you end up with is N different testing methods for N different packages and no hope of automation or of being able to do integration testing along with the other packages. I am all for packages having their own tests built-in too, but they should be accessible and run by conda tests.
Do you mean was this a mistake, no absolutely not! This testing scheme was designed and discussed.
You can but it would be a huge amount of work since testing now requires the final tarball. Can you explain why my workarounds are not appropriate for you? |
The other thing that independent testing brings us is the ability to cross-compile, then send the package to some different target hardware for testing. |
Thank you for that detailed response. I understand the value of testing for cross-compiled programs, but since I had not heard of
I'm not advocating for the termination of the You workarounds are fine. In fact, I will probably implement your second suggestion: rework your tests so they download the file that are needed before commencing the actual test. However, it would be convenient for everyone if conda was capable of doing this automatically by packaging the files described in |
I guess this comes down to a difference of opinion about what those tests are in meta.yaml and about testing philosophy. The things we speak of, these conda ecosystem tests and general software tests are not mutually exclusive and in most cases the conda ones build on the upstream software's existing tests. You said earlier:
These are not the (upstream) package developer's tests. These are the conda package packager's tests. To me they exist to ensure the quality and compatibility of the final binary artefact, and each packager is free to pick the weapons at their disposal that will best do that. In some cases it could mean installing a known-to-cause-trouble-before dependency alongside the test package (we have formalised this into downstream tests too) and running a few simple checks, but in other cases it could mean a lot more. The upstream software developer is free to add their own tests to their source code, then, through their build system make those tests installable if they wish to. If they can't be made installable then all we can do is run them during builds, as in It also means any collection of these binary packages remains testable into the future (e.g. when new OS versions or hardrware comes out). Clearly sometimes test files will be large. Conda-build offers a solution for that, It would be possible to do something to split off the test data and scripts into a seperate package, then make the tests in the real package simple stubs that defer to the test package. If someone were to make a patch for this I wouldn't oppose it. I guess I don't really see the point since chopping and changing how testing is done is so easy and we have so many options. .. in fact in the past we used to collate the test data and scripts for many packages into one package but this was very clumsy so we changed it to the way it is now! Everything gets put in the package (unless you use test/requires) and packages are atomically and collaboratively testable and no one has to mess about with other files. |
Thanks for all your helpful discussion! In the short term, I have used |
Hi there, thank you for your contribution! This issue has been automatically locked because it has not had recent activity after being closed. Please open a new issue if needed. Thanks! |
Actual Behavior
Source files listed in the
test
section ofmeta.yaml
are included in the packaged tarball. Is there a way to exclude them from the tarball, but still use them for running tests? I have only found how to exclude files from a package, but this method cannot be used because we are talking about files copied into the test environment.Expected Behavior
Files copied from the source to the test environment are only used for post-build tests and are not distributed with the final package. This allows checking that the build is correct while not significantly increasing the final package size when test files are large.
Steps to Reproduce
If
meta.yaml
contains, then
my_package.tar.bz2
contains/info/a_folder_for_tests/*
Output of conda info
The text was updated successfully, but these errors were encountered: