Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
kbjarkefur committed Jan 22, 2024
2 parents cfd5bc3 + 28bb6c4 commit ca4dad9
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 90 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
53 changes: 0 additions & 53 deletions src/tests/repado.do

This file was deleted.

18 changes: 18 additions & 0 deletions src/tests/repado/repado-schema.do
Original file line number Diff line number Diff line change
@@ -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
51 changes: 42 additions & 9 deletions src/tests/repado/repado.do
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 0 additions & 16 deletions src/tests/repkit.do

This file was deleted.

16 changes: 16 additions & 0 deletions src/tests/repkit/repkit.do
Original file line number Diff line number Diff line change
@@ -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
13 changes: 7 additions & 6 deletions src/tests/reprun/reprun.do
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* TODO: replace with reproot
* Kristoffer's root path
if "`c(username)'" == "wb462869" {
global clone "C:\Users\wb462869\github\repkit"
Expand All @@ -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

Expand 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"
Expand All @@ -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

0 comments on commit ca4dad9

Please sign in to comment.