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

Show example of using package tests as workload(s)? #44

Open
bdklahn opened this issue Jan 15, 2025 · 2 comments
Open

Show example of using package tests as workload(s)? #44

bdklahn opened this issue Jan 15, 2025 · 2 comments

Comments

@bdklahn
Copy link

bdklahn commented Jan 15, 2025

Thanks for this useful package!

It seems workloads would (should?) be redundant with things also run in the tests. Could the workload include() (certain) tests?
E.g.

include(joinpath(@__DIR__, "test", "common_calls.jl"))

I don't know if using Test could be eval'd in the setup, or if this would require Test to be an actual dep of the package (usually undesireable).

I.e., I'd envision runtests.jl to include() the individual test set files, as is done with many packages. Then the workload could include() a subset of those.

I suppose I could test this idea out.

Just a thought.

@xgdgsc
Copy link

xgdgsc commented Mar 7, 2025

Did you test it out? Would using https://www.julia-vscode.org/docs/stable/userguide/testitems/#Running-tests-from-the-command-line help to make it standard workflow?

@bdklahn
Copy link
Author

bdklahn commented Mar 16, 2025

Did you test it out? Would using https://www.julia-vscode.org/docs/stable/userguide/testitems/#Running-tests-from-the-command-line help to make it standard workflow?

I have not. I always seem to have more things that I have/want to do than I seem to have time for. :-)

But TestItems.jl does seem like the best/standard way to enable something like this. It looks like maybe that is already used in many Julia packages. I wonder if @davidantoff or others already know of good examples of best practice patterns of using this. I.e. I wonder if it would then be less confusing to people to then make the decision to put all the tests inline under src. Or if it is is easy enough to keep the traditional location under the test directory.
I guess that might be what you're implying . . . Maybe testitems is used in the runtests.jl (as traditionally), but then the main package can also use this package to run certain ones (E.g. to precompile). It seems like there are also macros to share "snippits" and testitem "modules". It's just not 100% clear to me what the "right"/clean way is to do this. I.e., if a person wants to use a standard test/runntests.jl pattern, but also pluck out some of the items for precompile. I'm probably making this too complicated, in my mind. :-)

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

No branches or pull requests

2 participants