requirements_from_tests | R Documentation |
If you were previously linking stories directly to tests, and
you would like to begin using requirements, use req_df_from_tests()
and
req_df_to_yaml()
to create a requirements YAML file that parses
requirement descriptions from test names. Then use
stories_replace_tests_with_reqs()
to edit your stories YAML to reference
the newly created requirements.
req_df_from_tests(test_df) req_df_to_yaml(req_df, out_file) stories_replace_tests_with_reqs(stories_file, req_spec)
test_df |
Tibble of tests results, as returned from
|
req_df |
Tibble of requirements, as returned from |
out_file |
Path to write requirements YAML file to. |
stories_file |
Path to write stories YAML file that will be modified on disk. |
req_spec |
Tibble of requirements, as returned from |
Note that these functions are designed to help you convert a repo that previously did not use requirements into one that does. They are not meant for continued use after that. Going forward, requirements should be specified in the requirements YAML file, instead of being pull through from test names
req_df_from_tests()
: Create new requirements tibble from test
results tibble.
req_df_to_yaml()
: Write requirements YAML file from
requirements tibble.
stories_replace_tests_with_reqs()
: Modify existing stories YAML to reference
new requirements instead of tests.
## Not run: # run your test suite to get a tibble of test names and IDs test_res <- mrgvalprep::parse_testthat_list_reporter( devtools::test(Reporter = testthat::ListReporter) ) # create requirements tibble and write to new YAML req_df <- req_df_from_tests(test_res) req_df_to_yaml(req_df, "inst/validation/requirements.yaml") # edit existing stories YAML stories_replace_tests_with_reqs("inst/validation/stories.yaml", req_df) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.