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

Properly handle zero regions selected in review configuration #44

Merged
merged 14 commits into from
Jul 12, 2024

Conversation

jthompson-arcus
Copy link
Collaborator

Fixes #35

Selecting zero regions will now update the site picker input. Selection zero sites will also result in user feedback. Below is a snapshot of the new behavior.

Snag_422142 Snag_423680

@jthompson-arcus jthompson-arcus linked an issue Jul 11, 2024 that may be closed by this pull request
@jthompson-arcus jthompson-arcus requested a review from LDSamson July 11, 2024 14:40
@jthompson-arcus
Copy link
Collaborator Author

A test has also been added for this situation.

@LDSamson
Copy link
Collaborator

LDSamson commented Jul 12, 2024

@jthompson-arcus Thanks for the PR, it works well! I added a suggestion for a minor improvement of the added test. For the rest it is all good I think.

@jthompson-arcus
Copy link
Collaborator Author

I did end up wrapping the test in test_that(). Main thing is that the environment within that function is different. You have to use clinsight:::function() to access the modules.

I think maybe I should switch it back though because it is currently registering a skipped test.

@LDSamson
Copy link
Collaborator

@jthompson-arcus two final comments, then I'd be fine if you finalize this: maybe remove both the clinsight::: expressions as well now that it is not needed anymore. And the version number can be bumped again since I just merged Aarons PR with version number 9005 with the dev branch. Have a nice weekend!

@jthompson-arcus
Copy link
Collaborator Author

Unless they are causing harm in some way I would prefer to leave the clinsight:::function() calls. Otherwise you cannot run the code line by line when building or debugging the test.

@LDSamson
Copy link
Collaborator

@jthompson-arcus two final comments, then I'd be fine if you finalize this: maybe remove both the clinsight::: expressions as well now that it is not needed anymore. And the version number can be bumped again since I just merged Aarons PR with version number 9005 with the dev branch. Have a nice weekend!

Sorry I just saw you left the clinsight::: expressions intentionally. I am not a fan of the notation, but provided that it does not give problems with renv when you reload the package (haven't got the time to test it), I would be okay to leave it in, if it is easier for you to run the tests. In the future, it would be nice to find a better solution for this though.

Merge branch 'dev' into jt-35-site_edge_case

# Conflicts:
#	DESCRIPTION
@jthompson-arcus
Copy link
Collaborator Author

I see. Would you be okay if I just add clinsight to the list of ignored packages for renv?

@jthompson-arcus
Copy link
Collaborator Author

In the future, it would be nice to find a better solution for this though.

I'm personally actually curious how your tests were working without using it. I thought it was the only way to write "dummy" app tests for individual modules. If the code was encased in test_that(), I don't think you can get the test working without using clinsight:::function().

@jthompson-arcus
Copy link
Collaborator Author

I have decided to remove the ::: calls. While I think in this use case they are fine since we would be referencing our own package, it is considered bad practice. This did send me down a little bit of a rabbit hole though and I found the following article that I thought was an interesting and informative read: https://www.tidyverse.org/blog/2022/09/playing-on-the-same-team-as-your-dependecy/.

@jthompson-arcus jthompson-arcus merged commit 6cd1a5b into dev Jul 12, 2024
2 checks passed
@jthompson-arcus jthompson-arcus deleted the jt-35-site_edge_case branch July 12, 2024 17:25
@LDSamson
Copy link
Collaborator

In the future, it would be nice to find a better solution for this though.

I'm personally actually curious how your tests were working without using it. I thought it was the only way to write "dummy" app tests for individual modules. If the code was encased in test_that(), I don't think you can get the test working without using clinsight:::function().

We can have a short meeting about it this week if you want. I am also curious about the problems you are encountering.
The process I try to follow for module tests is as described here.

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.

Review configuration - general improvements
2 participants