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

[Page 4] Create unit tests for page 4 functions #120

Open
4 tasks
Tracked by #123
statnmap opened this issue May 18, 2022 · 0 comments
Open
4 tasks
Tracked by #123

[Page 4] Create unit tests for page 4 functions #120

statnmap opened this issue May 18, 2022 · 0 comments

Comments

@statnmap
Copy link
Collaborator

statnmap commented May 18, 2022

As a maintainer, I'd like to use the last versions of function to update target values for unit tests, so that I can update my source database without breaking the package

Success criteria

  • If I update my database, I can update the targets values of the unit tests with a single source()
  • After both updates, the package should pass all unit tests accordingly

Technical how

Current behaviour

  • Target values for page 4 unit tests is currently based on file "data-raw/altas_simulation.R"
    • If I source("data-raw/altas_simulation.R"), all target outputs are updated for unit tests.

Why is this a problem ?

The current "data-raw/altas_simulation.R" is based on the first version of R scripts provided by the client. After code rework, ThinkR wanted to be sure they could reproduce the same outputs as the client. This has been treated and validated through this issue: #19

Today, fix and improvments of the core of the models are directly made in the functions of the package. This means that outputs can (will) differ from original code on purpose. Hence, we need "data-raw/altas_simulation.R" to be up-to-date with the last version of models.

What to do?

  • Modify the content of this "data-raw/altas_simulation.R" file to directly use the functions of the package. Hence, if the core is changed, the outputs are also changed accordingly.
  • Warn the developer about this update, because they first need to be sure the outputs are the one really targeted, before updating the targets. To do so, they can use the vignette in "data-raw/be-page4-future.Rmd" to explore the outputs of the model, before running and updated unit tests.
statnmap added a commit that referenced this issue May 18, 2022
Why?

Be sure reformatting gives correct results

What?

Test intermediate outputs

issue #120
@statnmap statnmap mentioned this issue May 18, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant