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

Skip tests/examples when packages in Suggest section are not installed #518

Merged

Conversation

averissimo
Copy link
Contributor

Changes description

  • Handles @examples
    • with @examplesIf requireNamespace("MultiAssayExperiment") as suggested here
    • Conditional clause replacing miniACC with empty data.frame
  • Skips tests that use {MAE} or {SE}
  • Skips tests that use {withr}

Discussions

  • That's not a reason to skip tests. MAE is in Suggests so installing is the responsibility of the person who wants to run tests, i.e. not the end user. If someone uses teal with MAE data, they most likely have the package installed.

  • Some generic tests and examples for filter_state_api are complex cases that join together normal data frames with MAE
    • These could be broken down to 2 examples.
  • If we merge this it also means tests using {withr} should be skipped
    • Seems silly, but necessary to be a complete compliance

WDYT?

@pawelru
Copy link
Contributor

pawelru commented Jan 11, 2024

I think this is the correct way to move forward.

I have one more thing to check that I noticed elsewhere and unfortunately I cannot check it locally for some reason. If a dependent package is missing and there are references in roxygen it will end-up with a following note:

* checking Rd cross-references ... NOTE
Unknown package ‘teal’ in Rd xrefs

Or it might be due to a given package is missing on rdrr.io / CRAN - I'm not 100% sure. I haven't deep dive into this issue but I think it might be related in this context. Will you be able to check it? Just remove package locally and run R CMD CHECK.

@averissimo
Copy link
Contributor Author

It looks like a rdrr.io / CRAN check. As I've modified the docs to also have some links to {future} and {mistery} (latter doesn't exist) and it only complained about {teal} and {mistery}

image

(ignore the dev-av warning, it's for local hacking)

R/filter_panel_api.R Outdated Show resolved Hide resolved
@chlebowa
Copy link
Contributor

chlebowa commented Jan 15, 2024

So I see that @examplesIf prevents the examples from running in checks unless the condition is met but they are still displayed. Sounds good to me.


* checking Rd cross-references ... NOTE
Unknown package ‘teal’ in Rd xrefs

I'm not getting this, only

❯ checking package dependencies ... NOTE
  Package suggested but not available for checking: ‘MultiAssayExperiment’

examplesIf 👍
remove withr 👍

@averissimo averissimo force-pushed the soft-dependencies@pre-release-cleanup@main branch from 4f9f67c to 2cb1cda Compare January 15, 2024 16:35
@averissimo averissimo marked this pull request as ready for review January 16, 2024 13:59
@chlebowa
Copy link
Contributor

I suppose we will do this in all package, not just teal.slice, correct?

I have uninstalled MultiAssayExperiment to test this and now tests in teal fail, so we don't have to look far.

Copy link
Contributor

@chlebowa chlebowa left a comment

Choose a reason for hiding this comment

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

👍

@averissimo averissimo merged commit 3220aac into pre-release-cleanup@main Jan 17, 2024
@averissimo averissimo deleted the soft-dependencies@pre-release-cleanup@main branch January 17, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants