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

Adding Retest #1052

Closed
wants to merge 3 commits into from
Closed

Adding Retest #1052

wants to merge 3 commits into from

Conversation

tengis-nrl
Copy link
Collaborator

Thanks for opening a PR to PowerSystems.jl, please take note of the following when making a PR:

Check the contributor guidelines

  1. Add a description of the changes proposed in the pull request.
  2. Is my PR fixing an open issue? Add the reference to the related issue
  3. If you are contributing a new struct: please refer to the testing requirements for new structs

end
end


Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tengis-nrl you should learn how to invoke the formatter set up in each Sienna repository so you can deal with these issues proactively. I can help you with that sometime if you need

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about during the next time we meet? Thanks!


end

using .PowerSystemsTests
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
using .PowerSystemsTests
using .PowerSystemsTests

end
end

recursive_includet("PowerSystemsTests.jl")
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
recursive_includet("PowerSystemsTests.jl")
recursive_includet("PowerSystemsTests.jl")

test/runtests.jl Outdated
nothing
end
include("PowerSystemsTests.jl")
run_tests()
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
run_tests()
run_tests()

@daniel-thom daniel-thom changed the base branch from main to psy4 February 14, 2024 02:29
@tengis-nrl tengis-nrl assigned GabrielKS and unassigned GabrielKS Feb 14, 2024
@tengis-nrl tengis-nrl requested a review from GabrielKS February 14, 2024 21:41
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @GabrielKS, this file was added to use ReTest instead of the current testing package. There is a file called InfrastructureSystemsTests.jl in IS that has almost the same code as this one. @daniel-thom was wondering how we can avoid code duplication. Specifically, he asked "Is there a way to avoid that without making the ReTest.jl package a dependency of PSY? Keep in mind that there are dozens of Sienna packages that should use this test pattern." Any suggestion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Dan and I talked about this a while ago and the options I see are:

  1. Put the stuff that would be duplicated into InfrastructureSystems.jl. Advantage: no massive code duplication across Sienna repos, just call the relevant thing from IS. Disadvantage: ReTest.jl would need to be a non-test dependency of IS (and therefore, transitively, of all the other Sienna packages)
  2. Current approach: reimplement for every repository. Advantage: ReTest.jl can be just a test dependency. Disadvantage: massive code duplication.
  3. Create a new package that is just for testing, put the stuff that would be duplicated there. Advantages: no massive duplication and ReTest is just a test dependency. Disadvantage: we have to maintain a whole separate package for this.
  4. Same as 3 but with a submodule or something instead of a package. Same advantages as 3. Disadvantage: it's really annoying to work with submodules.

I don't think we're going to come up with anything that doesn't have some of those disadvantages. I might not fully appreciate the costs of maintaining a whole separate package, but option 3 looks the most attractive to me. We could also do something like this to remove the duplication of all our formatting scripts.

Copy link
Member

Choose a reason for hiding this comment

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

For the time being we will keep 2. as the option since it also creates a headache to maintain package dependencies to do any of the others.

@@ -0,0 +1,13 @@
using Revise
Copy link
Collaborator

@GabrielKS GabrielKS Feb 14, 2024

Choose a reason for hiding this comment

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

Copied from the IS PR: Seems like even if the best practice is to install Revise globally, if our tests are going to depend it we ought to have it in test/Project.toml

Copy link
Member

Choose a reason for hiding this comment

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

remove, we need to remove from IS too.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file is optional. Users don’t have to call it. I say leave it the way it is. The instructions should advise you to install TestEnv.jl and Revise.jl globally.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, that works for me

Copy link
Collaborator

Choose a reason for hiding this comment

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

Dan and I talked about this a while ago and the options I see are:

  1. Put the stuff that would be duplicated into InfrastructureSystems.jl. Advantage: no massive code duplication across Sienna repos, just call the relevant thing from IS. Disadvantage: ReTest.jl would need to be a non-test dependency of IS (and therefore, transitively, of all the other Sienna packages)
  2. Current approach: reimplement for every repository. Advantage: ReTest.jl can be just a test dependency. Disadvantage: massive code duplication.
  3. Create a new package that is just for testing, put the stuff that would be duplicated there. Advantages: no massive duplication and ReTest is just a test dependency. Disadvantage: we have to maintain a whole separate package for this.
  4. Same as 3 but with a submodule or something instead of a package. Same advantages as 3. Disadvantage: it's really annoying to work with submodules.

I don't think we're going to come up with anything that doesn't have some of those disadvantages. I might not fully appreciate the costs of maintaining a whole separate package, but option 3 looks the most attractive to me. We could also do something like this to remove the duplication of all our formatting scripts.

end
end


Copy link
Collaborator

Choose a reason for hiding this comment

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

@tengis-nrl you should learn how to invoke the formatter set up in each Sienna repository so you can deal with these issues proactively. I can help you with that sometime if you need

@daniel-thom
Copy link
Contributor

I like option 3 the best. Good point about the formatter scripts. Hopefully, this won’t change often. Also, the formatter version would be fixed in this package.

@jd-lara
Copy link
Member

jd-lara commented Feb 14, 2024

I like option 3 the best. Good point about the formatter scripts. Hopefully, this won’t change often. Also, the formatter version would be fixed in this package.

@pesap suggested adding a modified GitHub action that can commit the required formatter changes.

@jd-lara
Copy link
Member

jd-lara commented Feb 16, 2024

@daniel-thom do you want to merge this or go ahead with the creation of the testing package?

@daniel-thom
Copy link
Contributor

@daniel-thom do you want to merge this or go ahead with the creation of the testing package?

I think we should create SiennaDevUtils.jl, add these test functions and the formatter, and then change IS and PSY to use it.

@jd-lara
Copy link
Member

jd-lara commented Feb 27, 2024

closing since the preferred solution of creating a testing package will be implemented.

@jd-lara jd-lara closed this Feb 27, 2024
@tengis-nrl tengis-nrl deleted the Trying-ReTest branch March 7, 2024 22:06
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.

4 participants