diff --git a/.gitignore b/.gitignore index 620bb78..67cec82 100644 --- a/.gitignore +++ b/.gitignore @@ -50,15 +50,14 @@ !src/stata.toc !src/*.pkg -# Markdown +# Markdown and web docs files !/**/*.md +!src/dev/assets/*.png +!src/dev/assets/*.css -* Ignore the local env -/**/plus-ado/ +* Ignore the local dev env set up by repado +src/tests/dev-env/ * Ignore local test output /**/run1 /**/run2 - -# Adodown web docs -!/**/dev/*.png diff --git a/README.md b/README.md index 5d0b4f6..e72bff1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Currently, this toolkit has the following commands: | --- | --- | | [repado](https://dime-worldbank.github.io/repkit/reference/repado.html) | Command used to manage project ado command dependencies. This command provides a way to make sure that all team members as well as future reproducers of the projects code use the exact same version of all command dependencies. | | [repkit](https://dime-worldbank.github.io/repkit/reference/repkit.html) | Command named the same as the package. Most important purpose is that this command makes the code `which repkit` work. | +| [reprun](https://dime-worldbank.github.io/repkit/reference/reprun.html) | This command is used to automate reproducibility checks by running a do-file or a set of do-files and compare all state values (RNG-value, datasignature etc.) between the two runs. This command is currently only release as a beta-version. | # Installation diff --git a/src/tests/repado.do b/src/tests/repado.do deleted file mode 100644 index 7426a46..0000000 --- a/src/tests/repado.do +++ /dev/null @@ -1,53 +0,0 @@ - - local src "C:\Users\wb462869\github\repkit\src" - local ado "`src'/ado" - local out "`src'/tests/output/repado" - - - do "`ado'/repado.ado" - - *********************************************** - **** Test all different mode settings - - - repado , adopath("`out'/ado") mode("nostrict") - return list - assert "`r(repado_mode)'" == "nostrict" - assert "`r(repado_path)'" == "`out'/ado" - - repado using "`out'/ado", mode("nostrict") - assert "`r(repado_mode)'" == "nostrict" - assert "`r(repado_path)'" == "`out'/ado" - - repado using "`out'/ado" - assert "`r(repado_mode)'" == "strict" - assert "`r(repado_path)'" == "`out'/ado" - - repado , adopath("`out'/ado") mode("strict") - assert "`r(repado_mode)'" == "strict" - assert "`r(repado_path)'" == "`out'/ado" - - repado , adopath("`out'/ado") nostrict - assert "`r(repado_mode)'" == "nostrict" - assert "`r(repado_path)'" == "`out'/ado" - - repado , adopath("`out'/ado") - assert "`r(repado_mode)'" == "strict" - assert "`r(repado_path)'" == "`out'/ado" - - repado using "`out'/ado", mode("nostrict") - assert "`r(repado_mode)'" == "nostrict" - assert "`r(repado_path)'" == "`out'/ado" - - repado using "`out'/ado", mode("strict") - assert "`r(repado_mode)'" == "strict" - assert "`r(repado_path)'" == "`out'/ado" - - repado using "`out'/ado", - assert "`r(repado_mode)'" == "strict" - assert "`r(repado_path)'" == "`out'/ado" - - repado using "`out'/ado", nostrict - assert "`r(repado_mode)'" == "nostrict" - assert "`r(repado_path)'" == "`out'/ado" - \ No newline at end of file diff --git a/src/tests/repado/repado-schema.do b/src/tests/repado/repado-schema.do new file mode 100644 index 0000000..2e9c936 --- /dev/null +++ b/src/tests/repado/repado-schema.do @@ -0,0 +1,18 @@ + + +global repkit "/Users/bbdaniels/GitHub/repkit" + +repado "${repkit}/src/tests/dev-env" + +copy "https://github.com/graykimbrough/uncluttered-stata-graphs/raw/master/schemes/scheme-uncluttered.scheme" /// + "${repkit}/src/tests/plus-ado/scheme-uncluttered.scheme" , replace + + set scheme uncluttered , perm + graph set eps fontface "Helvetica" + + sysuse auto, clear + scatter price mpg + + + +// End diff --git a/src/tests/repado/repado.do b/src/tests/repado/repado.do index b0a00ed..6c41172 100644 --- a/src/tests/repado/repado.do +++ b/src/tests/repado/repado.do @@ -1,18 +1,51 @@ + * TODO: replace with reproot + local repkit "C:/Users\wb462869\github\repkit\" + local out "`repkit'/src/tests/repado/output" -global repkit "/Users/bbdaniels/GitHub/repkit" + * Load the commands + do "`repkit'/src/ado/repado.ado" -repado , adopath("${repkit}/src/tests/plus-ado") mode(strict) + *********************************************** + **** Test all different mode settings -copy "https://github.com/graykimbrough/uncluttered-stata-graphs/raw/master/schemes/scheme-uncluttered.scheme" /// - "${repkit}/src/tests/plus-ado/scheme-uncluttered.scheme" , replace + repado , adopath("`out'/ado") mode("nostrict") + return list + assert "`r(repado_mode)'" == "nostrict" + assert "`r(repado_path)'" == "`out'/ado" - set scheme uncluttered , perm - graph set eps fontface "Helvetica" + repado using "`out'/ado", mode("nostrict") + assert "`r(repado_mode)'" == "nostrict" + assert "`r(repado_path)'" == "`out'/ado" - sysuse auto, clear - scatter price mpg + repado using "`out'/ado" + assert "`r(repado_mode)'" == "strict" + assert "`r(repado_path)'" == "`out'/ado" + repado , adopath("`out'/ado") mode("strict") + assert "`r(repado_mode)'" == "strict" + assert "`r(repado_path)'" == "`out'/ado" + repado , adopath("`out'/ado") nostrict + assert "`r(repado_mode)'" == "nostrict" + assert "`r(repado_path)'" == "`out'/ado" -// End + repado , adopath("`out'/ado") + assert "`r(repado_mode)'" == "strict" + assert "`r(repado_path)'" == "`out'/ado" + + repado using "`out'/ado", mode("nostrict") + assert "`r(repado_mode)'" == "nostrict" + assert "`r(repado_path)'" == "`out'/ado" + + repado using "`out'/ado", mode("strict") + assert "`r(repado_mode)'" == "strict" + assert "`r(repado_path)'" == "`out'/ado" + + repado using "`out'/ado", + assert "`r(repado_mode)'" == "strict" + assert "`r(repado_path)'" == "`out'/ado" + + repado using "`out'/ado", nostrict + assert "`r(repado_mode)'" == "nostrict" + assert "`r(repado_path)'" == "`out'/ado" diff --git a/src/tests/repkit.do b/src/tests/repkit.do deleted file mode 100644 index fb7dbca..0000000 --- a/src/tests/repkit.do +++ /dev/null @@ -1,16 +0,0 @@ - - local src "C:\Users\wb462869\github\repkit\src" - local ado "`src'/ado" - local out "`src'/tests/output/repado" - - do "`ado'/repkit.ado" - - * Test base case - repkit - - * test beta output - repkit "beta dimetest" - - * Test that invalid command is caught - cap repkit "invalid subcommand" - assert _rc == 99 \ No newline at end of file diff --git a/src/tests/repkit/repkit.do b/src/tests/repkit/repkit.do new file mode 100644 index 0000000..74b3cda --- /dev/null +++ b/src/tests/repkit/repkit.do @@ -0,0 +1,16 @@ + + * TODO: replace with reproot + local repkit "C:/Users\wb462869\github\repkit\" + + * Load the commands + do "`repkit'/src/ado/repkit.ado" + + * Test base case + repkit + + * test beta output + repkit "beta dimetest" + + * Test that invalid command is caught + cap repkit "invalid subcommand" + assert _rc == 99 diff --git a/src/tests/reprun/reprun.do b/src/tests/reprun/reprun.do index 314fd50..59db63a 100644 --- a/src/tests/reprun/reprun.do +++ b/src/tests/reprun/reprun.do @@ -1,4 +1,5 @@ + * TODO: replace with reproot * Kristoffer's root path if "`c(username)'" == "wb462869" { global clone "C:\Users\wb462869\github\repkit" @@ -19,11 +20,11 @@ global wca "${run_fldr}/with-clear-all" global waf "${run_fldr}/with-ado-folder" - * Install the version of this package in + * Install the version of this package in * the plus-ado folder in the test folder - repado , adopath("${test_fldr}/plus-ado/") mode(strict) + repado "${test_fldr}/dev-env/" cap net uninstall repkit - net install repkit, from("${src_fldr}") replace + net install repkit, from("${src_fldr}") replace file close _all @@ -34,8 +35,8 @@ cap mkdir "${tf}/output-3" reprun "${tf}/target-1.do" using "${tf}/output-1" , debug reprun "${tf}/target-1.do" using "${tf}/output-2" , s(srng loop) - reprun "${tf}/target-1.do" using "${tf}/output-3" , compact s(rng srng dsig) - reprun "${tf}/target-1.do" , verbose + reprun "${tf}/target-1.do" using "${tf}/output-3" , compact s(rng srng dsig) + reprun "${tf}/target-1.do" , verbose * Example A - single file cap mkdir "${sf}/output" @@ -58,4 +59,4 @@ reprun "${wca}/main.do" using "${wca}/output" , debug * Example F - with project ado-folder - reprun "${waf}/main.do" using "${waf}/output" , debug + reprun "${waf}/main.do" using "${waf}/output" , debug