chapel icon indicating copy to clipboard operation
chapel copied to clipboard

[Design] Should `setuptools` be listed in the `third-party/chpl-venv` dependencies for `start_test`?

Open lydia-duncan opened this issue 2 months ago • 8 comments

setuptools was added as a dependency for start_test in this commit for Arkouda testing.

On the one hand, it's good to have dependencies listed in as few places as possible, to reduce complexity and make it easier to analyze what the dependencies of a project are. On the other hand, if it's only useful for one test directory, arguably it should be limited to that test directory - this will make it easier to recognize if it becomes no longer needed.

lydia-duncan avatar Sep 08 '25 15:09 lydia-duncan

@jabraham17 - I strongly suspect you have additional concerns I haven't listed here :)

lydia-duncan avatar Sep 08 '25 15:09 lydia-duncan

My primary concern is that we adjusted the dependencies for start_test (i.e. a test runner) to make 1 "test" pass (arkouda).

This is for 2 reasons

  • from a clean code perspective, this feels very wrong. Why does one test infect everything else? The test should just handle getting the right dependencies
  • are we covering up an issue in Arkouda that should be fixed?

jabraham17 avatar Sep 08 '25 15:09 jabraham17

  • from a clean code perspective, this feels very wrong. Why does one test infect everything else? The test should just handle getting the right dependencies

Yes, but also, if multiple tests end up requiring the same thing, it's a lot harder to notice if they're all just handling it themselves. Having a centralized place helps avoid things like accidentally having one test depend on another directory running before it to get the dependencies it needs, or paying the cost of downloading and installing something twice if they would otherwise end up truly isolated. It's a tradeoff, imo

lydia-duncan avatar Sep 08 '25 15:09 lydia-duncan

Yes, but also, if multiple tests end up requiring the same thing, it's a lot harder to notice if they're all just handling it themselves. Having a centralized place helps avoid things like accidentally having one test depend on another directory running before it to get the dependencies it needs, or paying the cost of downloading and installing something twice if they would otherwise end up truly isolated.

I somewhat agree. Having multiple tests have to duplicate dependency logic is bad, but in my opinion thats a problem for the test author, not the test runner. For example, this is why for the python numpy tests we have test/library/packages/Python/correctness/arrays/PRETEST which installs numpy for all the tests in the directory. It does not matter if you do start_test test/library/packages/Python/correctness/arrays or start_test test/library/packages/Python/correctness/arrays/someChapelFile.chpl, you still get the right dependencies installed once. This did not require editing start_test to achieve.

Needing to specially modify start_test to make a test work is a failure of start_test

It's a tradeoff, imo

I disagree with this, I think we can have our cake and eat it too :). We have the mechanisms in start_test to handle dependencies (maybe having to write a custom PRECOMP or PRETEST is not the cleanest thing in the world, but it works well) without needing to specialize start_test

jabraham17 avatar Sep 08 '25 15:09 jabraham17

For example, this is why for the python numpy tests we have test/library/packages/Python/correctness/arrays/PRETEST which installs numpy for all the tests in the directory. It does not matter if you do start_test test/library/packages/Python/correctness/arrays or start_test test/library/packages/Python/correctness/arrays/someChapelFile.chpl, you still get the right dependencies installed once. This did not require editing start_test to achieve.

Sure, but doesn't that potentially imply that numpy should be listed as a dependency of our testing system?

lydia-duncan avatar Sep 08 '25 16:09 lydia-duncan

No, numpy is a dependency of the tests themselves.

I am making a distinction between start_test the tool and $CHPL_HOME/test, the Chapel test suite

jabraham17 avatar Sep 08 '25 16:09 jabraham17

Related to the last comment: We distribute start_test in releases, but not $CHPL_HOME/test (outside of release/examples).

bradcray avatar Sep 08 '25 16:09 bradcray

We still list dependencies that are only for development. And numpy is also useful for the original Python interop, it's just something we expect users to install themselves.

lydia-duncan avatar Sep 08 '25 16:09 lydia-duncan