Closed AlexAxthelm closed 4 months ago
Docker image from this PR (2cca7bd7bc542b75a2121b7517994ce26041ad66) created
docker pull ghcr.io/rmi-pacta/workflow.factset:pr42
Note that this is a stopgap measure, for manual testing. I haven't found a good way to mock a PG database other than actually running one in a container, but that isn't going to play well with testthat
, so that's a different conversation.
Creating the code in tests/sql
was done by extracting snippets from the output of pg_dump -f foo.sql -F plain --schema-only
Future work:
Another note here: this is only doing "happy-path" testing.
I get an error when running docker-compose up
2.348 Error:
2.348 ! error in pak subprocess
2.348 Caused by error in `loadNamespace(x)`:
2.348 ! there is no package called ‘pkgdepends’
I suspect this is because of a combination of:
I modified the Dockerfile with FROM --platform=linux/amd64 rocker/r-ver:$R_VERS AS base
and it successfully built the image.
After that, I get the error
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /host_mnt/Users/cjrmi/github/pactaverse/workflow.factset/outputs
I suspect that means that ./outputs
must exist, or that I must point this
https://github.com/RMI-PACTA/workflow.factset/blob/455bb8441c55b1fbb27d9886eee81912060ef422/docker-compose.yml#L20
to an existing directory.
I created the directory ./outputs
first and then re-ran docker-compose up
and that appeared to function as expected.
Once that was running, I ran docker attach workflowfactset-workflow.factset-1
which drops me in a shell with prompt >
. It was not clear to me that this was an R prompt, but I tried running the R code in it
library(workflow.factset)
conn <- connect_factset_db()
issue_code_bridge <- get_issue_code_bridge(conn = conn)
issue_code_bridge
and I appear to get the same result as above 🎉
quit()
in the second shell and Ctl-C in the first, but not entirely sure it that is/was most appropriate or if anything else should be done.Thanks for the review @cjyetman. I've opened #43 to note the arm64
issues, and updated the readme with instructions.
Add a
docker-compose
file to spin up a testing database alongside the container for manual testing.Also add some mock testing data in support of
get_issue_code_bridge()
current testing steps:
Closes: #41