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

Re-organise tests. #2058

Closed
wants to merge 3 commits into from
Closed

Re-organise tests. #2058

wants to merge 3 commits into from

Conversation

yebai
Copy link
Member

@yebai yebai commented Jul 31, 2023

This PR makes it easy to run each test file individually locally:

shell> pwd
/Users/hg344/projects/Turing.jl

(test) pkg> activate test
  Activating project at `~/projects/Turing.jl/test`

julia> using Turing; include(pkgdir(Turing)*"/test/test_utils/test_utils.jl")

julia> include("test/modes/OptimInterface.jl")

This PR doesn't contain any functionality changes.

@yebai yebai changed the title Reorg tests. Re-organise tests. Jul 31, 2023
import LogDensityProblemsAD


#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we feel this is more readable than what we did before?

As in, why don't we just keep the separate files but include all of them in a single file?

Copy link
Member Author

@yebai yebai Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that anyone ever reads them.

I prefer to keep these code in fewer files since it often contains a collection of tiny utility sets.

Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm uncertain if this is an issue of Turing.jl or rather an issue of "standard Julia workflow".

What I usually do is that I take this "header" for the runtests.jl, paste it into a setup.jl file (similar to what you've done, but using include instead), and then use this is a setup-file for my testruns. I then use a custom script which re-runs the files I've specified whenever changes are made to either the package or the tests themselves (script: https://gist.github.com/torfjelde/62c1281d5fc486d3a404e5de6cf285d4). You might find this useful:)

@yebai
Copy link
Member Author

yebai commented Jul 31, 2023

@torfjelde Your workflow is much better! However, it is helpful to introduce a simple way to achieve a similar objective. Hence this PR.

@torfjelde
Copy link
Member

However, it is helpful to introduce a simple way to achieve a similar objective. Hence this PR.

Fair! But do we need to also remove all the files in the process? As in, why not just use include but add a single file that contains all these?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5719263514

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 0.0%

Totals Coverage Status
Change from base Build 5718410481: 0.0%
Covered Lines: 0
Relevant Lines: 1463

💛 - Coveralls

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (e22b77c) 0.00% compared to head (570fee5) 0.00%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #2058   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          21      21           
  Lines        1447    1447           
======================================
  Misses       1447    1447           
Files Changed Coverage Δ
src/Turing.jl 0.00% <ø> (ø)
src/mcmc/Inference.jl 0.00% <ø> (ø)
src/mcmc/abstractmcmc.jl 0.00% <ø> (ø)
src/mcmc/emcee.jl 0.00% <ø> (ø)
src/mcmc/ess.jl 0.00% <ø> (ø)
src/mcmc/gibbs.jl 0.00% <ø> (ø)
src/mcmc/gibbs_conditional.jl 0.00% <ø> (ø)
src/mcmc/hmc.jl 0.00% <ø> (ø)
src/mcmc/is.jl 0.00% <ø> (ø)
src/mcmc/mh.jl 0.00% <ø> (ø)
... and 3 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yebai
Copy link
Member Author

yebai commented Mar 11, 2024

Closed in favour of #2179

@yebai yebai closed this Mar 11, 2024
@yebai yebai deleted the hg/reorg-tests branch March 11, 2024 17:29
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

Successfully merging this pull request may close these issues.

None yet

3 participants