Skip to content

Commit

Permalink
Merge pull request #452 from molgenis/chore/semi-automatic-release-test
Browse files Browse the repository at this point in the history
chore: add semi automatic release testing script
  • Loading branch information
marikaris authored Jul 13, 2023
2 parents bce7433 + d9480f2 commit 68289fd
Show file tree
Hide file tree
Showing 3 changed files with 848 additions and 0 deletions.
41 changes: 41 additions & 0 deletions doc/release-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Release testing
## Prerequisites
- Testserver with release candidate available
- OIDC user with admin permissions on testserver
- Following libraries installed in R:
- cli
- getPass
- arrow
- httr
- jsonlite
- future
- MolgenisArmadillo (2.0.0 >)
- DSI
- dsBaseClient
- DSMolgenisArmadillo (2.0.0 >)
- resourcer (1.4.0 >)

*For full testing*
- Admin password by hand

*Minimal*
- OIDC user with admin/superuser permissions on testserver
- Someone with admin permissions available to take and regrant admin permissions to OIDC (super)user

With these minimal prerequisites met, tests for basic auth will be skipped and permissions will have to be set by hand
when asked by script.

OR
- A basic admin password

With these minimal prerequisites, the script will then skip the resources testing (is not possible with basic auth) and
testing as regular user

## Running the tests
1. Open your commandline
2. `cd` to the `scripts/release` folder of this repository
3. To run tests, type: `Rscript release-test.R`
4. Follow the directions in the script

If the script fails somewhere during the process, make sure you give your OIDC account back their admin permissions and
throw away the projects: cohort1, cohort2 and omics.
45 changes: 45 additions & 0 deletions scripts/release/install_release_script_dependencies.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

cat("
__ __ ____ _ _____ ______ _ _ _____ _____ _ _ _ _
| \\/ |/ __ \\| | / ____| ____| \\ | |_ _|/ ____| /\\ | (_) | |
| \\ / | | | | | | | __| |__ | \\| | | | | (___ / \\ _ __ _ __ ___ __ _ __| |_| | | ___
| |\\/| | | | | | | | |_ | __| | . ` | | | \\___ \\ / /\\ \\ | '__| '_ ` _ \\ / _` |/ _` | | | |/ _ \\
| | | | |__| | |___| |__| | |____| |\\ |_| |_ ____) | / ____ \\| | | | | | | | (_| | (_| | | | | (_) |
|_| |_|\\____/|______\\_____|______|_| \\_|_____|_____/ /_/ \\_\\_| |_| |_| |_|\\__,_|\\__,_|_|_|_|\\___/
_____ _ _ _
| __ \\ | | | | | |
| |__) |___| | ___ __ _ ___ ___ | |_ ___ ___| |_
| _ // _ \\ |/ _ \\/ _` / __|/ _ \\ | __/ _ \\/ __| __|
| | \\ \\ __/ | __/ (_| \\__ \\ __/ | || __/\\__ \\ |_
|_| \\_\\___|_|\\___|\\__,_|___/\\___| \\__\\___||___/\\__|
")
cat("Installing dependencies for release test\n")
install.packages("cli", repos = "http://cran.us.r-project.org")
library(cli)
cli_alert_success("package [cli] installed")
cli_alert_info("Installing other packages")

packages <- c("getPass", "arrow", "jsonlite", "future", "MolgenisArmadillo", "DSI", "devtools", "resourcer", "DSMolgenisArmadillo", "RCurl")

install_requirements_from_cran <- function(packages) {
n_requirements <- length(packages)
cli_progress_bar("Installing packages", total = n_requirements)
for (i in 1:n_requirements) {
pkg <- packages[i]
cli_alert_info(paste0("Installing ", pkg))
install.packages(pkg, repos = "http://cran.us.r-project.org", quiet=TRUE)
cli_progress_update()
}
cli_progress_done()
}
install_requirements_from_cran(packages)

library("devtools")
install_github("datashield/dsBaseClient")
#check if all packages are installed
cli_alert_success("All packages are installed")
Loading

0 comments on commit 68289fd

Please sign in to comment.