Skip to content

Commit ac2f57d

Browse files
committed
Some progress on fixing tests
1 parent db5c90a commit ac2f57d

15 files changed

+40
-22
lines changed

CHANGELOG

-5
This file was deleted.

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# Changelog
3+
4+
## 0.4.0 - 2017-12-01
5+
6+
* Update names of environment variables used to connect to the database, to align with other languages / runtime environments
7+
8+
## 0.3.0 - 2017-11-30
9+
10+
* Use RPostgreSQL instead of RJDBC to connect to the database
11+
12+
## Version 0.1. - 2015-11
13+
14+
* Initial version

R/fetchData.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' IN_DB_PASSWORD : Password for the database connection for input data
1616
#' IN_DB_SCHEMA : Optional schema by default for the database connection for input data
1717
#' @param query The SQL query to execute on the input database, defaults to the value of environment parameter PARAM_query
18-
#' @param inFormat Hint for the exact shape of the data stored in the database. Possible values are INTERMEDIATE_RESULTS, OTHER. Defaults to the value of environment parameter IN_FORMAT
18+
#' @param inFormat Hint for the exact shape of the data stored in the database. Possible values are PARTIAL_RESULTS, OTHER. Defaults to the value of environment parameter IN_FORMAT
1919
#' @param conn The connection to the database, default to global variable in_conn
2020
#' @export
2121
fetchData <- function(

data

-1
This file was deleted.

dev-federation.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
## TODO: not functional anymore
4+
35
# Develop on a simulated Federation
46

57
WORK_DIR="$(pwd)"
@@ -79,7 +81,7 @@ $DOCKER run -v $WORK_DIR:/home/docker/data:rw \
7981
-e IN_JDBC_URL=jdbc:postgresql://indb:5432/postgres \
8082
-e IN_JDBC_USER=postgres \
8183
-e IN_JDBC_PASSWORD=test \
82-
-e IN_FORMAT=INTERMEDIATE_RESULTS \
84+
-e IN_FORMAT=PARTIAL_RESULTS \
8385
-e OUT_JDBC_DRIVER=org.postgresql.Driver \
8486
-e OUT_JDBC_JAR_PATH=/usr/lib/R/libraries/postgresql-9.4-1201.jdbc41.jar \
8587
-e OUT_JDBC_URL=jdbc:postgresql://outdb:5432/postgres \

dev.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
## TODO: not functional anymore
4+
35
WORK_DIR="$(pwd)"
46

57
if groups $USER | grep &>/dev/null '\bdocker\b'; then

dev/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737
- db
3838

3939
sample_data_db_setup:
40-
image: "hbpmip/sample-data-db-setup:0.4.0"
40+
image: "hbpmip/sample-data-db-setup:0.4.1"
4141
container_name: "sample-data-db-setup"
4242
environment:
4343
FLYWAY_DBMS: postgresql

dist.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
## TODO: not functional anymore
4+
35
WORK_DIR="$(pwd)"
46
shift
57

man/fetchData.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/saveResults.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

publish.sh

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if test $count -gt 0; then
1111
exit 1
1212
fi
1313

14+
./tests/test.sh
15+
1416
select_part() {
1517
local choice=$1
1618
case "$choice" in
@@ -56,6 +58,8 @@ git pull --tags
5658

5759
updated_version=$(bumpversion --dry-run --list patch | grep current_version | sed -r s,"^.*=",,)
5860

61+
./tests/test.sh
62+
5963
git push
6064
git push --tags
6165

tests/Dockerfile.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM hbpmip/r-base-build:3.4.2-2
22

33
COPY tests/test_local_dataset/testthat.R /src/tests/
44
COPY tests/test_local_dataset/testthat/ /src/tests/testthat/
5-
COPY CHANGELOG DESCRIPTION LICENSE NAMESPACE README.md /src/rmipadaptor/
5+
COPY CHANGELOG.md DESCRIPTION LICENSE NAMESPACE README.md /src/rmipadaptor/
66
COPY R/ /src/rmipadaptor/R/
77
COPY man/ /src/rmipadaptor/man/
88

tests/test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function _cleanup() {
3434
$DOCKER_COMPOSE rm -f > /dev/null 2> /dev/null | true
3535
exit $error_code
3636
}
37-
trap _cleanup EXIT INT TERM
37+
#trap _cleanup EXIT INT TERM
3838

3939
echo "Starting the databases..."
4040
$DOCKER_COMPOSE up -d db
@@ -53,4 +53,4 @@ $DOCKER_COMPOSE run r_test_local_dataset
5353

5454
echo
5555
# Cleanup
56-
_cleanup
56+
#_cleanup

tests/test_local_dataset/testthat/testConnect.R

+6-6
Large diffs are not rendered by default.

tests/test_local_dataset/testthat/testSaveError.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test_that("We save the fact that there was an error", {
77
Sys.setenv(JOB_ID = job_id);
88
Sys.setenv(NODE = "local");
99
Sys.setenv(PARAM_query = "select * from brain_feature");
10-
Sys.setenv(OUT_FORMAT = "INTERMEDIATE_RESULTS");
10+
Sys.setenv(OUT_FORMAT = "PARTIAL_RESULTS");
1111
Sys.setenv(ERROR_FILE = "/tmp/errors.txt");
1212
Sys.setenv(OUTPUT_FILE = "/tmp/output.txt");
1313

0 commit comments

Comments
 (0)