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

[ENHANCEMENT] Filename convention for examples files to test #33

Closed
mtfishman opened this issue Dec 5, 2024 · 4 comments
Closed

[ENHANCEMENT] Filename convention for examples files to test #33

mtfishman opened this issue Dec 5, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mtfishman
Copy link
Member

I think right now we run all files that end in .jl in the examples folder, probably we should have a naming convention like testexample_f.jl to specify which ones should get run in the tests, since not all examples will be appropriate to run in tests, some may be setup files, etc.

@mtfishman mtfishman added the enhancement New feature or request label Dec 5, 2024
@mtfishman
Copy link
Member Author

A question in that case is if we should rename examples/README.jl to that naming convention, or treat README.jl as a special file that gets run anyway.

@lkdvos
Copy link
Collaborator

lkdvos commented Dec 6, 2024

I guess the question is probably what the intention is: are we running the examples files to ensure that they are still working, or do we intend to put some things in examples that are actually meant to test some behavior?

@mtfishman
Copy link
Member Author

mtfishman commented Dec 6, 2024

I guess the question is probably what the intention is: are we running the examples files to ensure that they are still working, or do we intend to put some things in examples that are actually meant to test some behavior?

I think both, I've found it is nice to use @test in example files anyway to demonstrate what the output should be without printing things. But I see your point, primarily it is meant to test examples don't get outdated (we often have that problem with ITensor examples...), so probably we should include all files by default (recursively in folders as well since it can be nice to organize examples into folders) and then have a syntax for ignoring ones that aren't appropriate to run in tests, like if they rely on some interactivity or take too long to run. So for example we could have a convention that examples with names of the form f_notest.jl don't get run, and also we can have a convention that code in certain folders are treated as "setup code" and also ignored, like #31.

@mtfishman
Copy link
Member Author

Closed by #41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants