Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ text-file format used to both describe and execute built-in tests.
## Execution environment
You will need: -

- Groovy
- Conda
- Groovy (v2.4)
- Python

Although the project is based on [Gradle], which is Groovy-based,
you will need to install **Groovy**. We've tested this framework using Groovy
Expand Down Expand Up @@ -170,10 +171,46 @@ that can be tested using `setup.py`. To test these modules run the
following from the `src/python` directory: -

$ python setup.py test


## Considerations for Windows
The tests and test framework are designed to operate from within a unix-like
environment but if you are forced to execute pipeline tests from Windows the
following approach is recommended: -

You will need:

- Conda
- Groovy (v2.4)
- Git-Bash

1. Install [Git for Windows]. This will give you a unix bash-like
execution environment
1. From within the Git-bash shell navigate to your pipelines project.
1. Ensure that you can execute both Python and Groovy from within the
Git-Bash shell (i.e. `python --version` and `groovy --version` work)
1. From the pipelines project root enter your Conda environment
with something like `source activate my-conda-env`. To run the
pipelines tests your environment must contain the rdkit package. It
can be installed with this command from within Conda...

$ conda install -c rdkit rdkit

1. Install additional modules required by `pipelines-utils` but
using its requirements file (which can be found in the `pipelines-utils`
sub-project): -

$ pip install -r requirements.txt

With the above steps complete you should be able to execute the pipelines
tester by navigating to the sub-module in your pipelines project: -

$ cd pipelines-utils
$ ./gradlew runPipelineTester

---

[Conda]: https://conda.io/docs/
[Git for Windows]: http://gitforwindows.org
[Gradle]: https://gradle.org
[Groovy]: http://groovy-lang.org
[PIP]: https://pypi.python.org/pypi
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Additional modules we depend on.
# Required from within an RDKIT Conda environment

matplotlib == 2.1.1
molvs == 0.0.9
standardiser == 0.1.9
11 changes: 10 additions & 1 deletion src/groovy/ContainerExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ class ContainerExecutor {
StringBuilder sout = new StringBuilder()
StringBuilder serr = new StringBuilder()

// Note: PIN and POUT have trailing forward-slashed for now
// Windows/Git-Bash PIN/POUT path tweak...
String osName = System.properties['os.name']
if (osName && osName.startsWith('Win')) {
pin = pin.replace('\\', '/')
pin = pin.replace('C:', '/c')
pout = pout.replace('\\', '/')
pout = pout.replace('C:', '/c')
}

// Note: PIN and POUT have trailing forward-slashes for now
// to allow a migratory use of $PIN}file references
// rather than insisting on ${PIN}/file which would fail if
// PIN wasn't defined - it's about lowest risk changes.
Expand Down
2 changes: 1 addition & 1 deletion src/groovy/PipelineTester.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

// Version
// Update with every change/release
String version = '2.1.0'
String version = '2.1.1'

println "+----------------+"
println "| PipelineTester | v$version"
Expand Down
14 changes: 13 additions & 1 deletion src/groovy/ShellExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ class ShellExecutor {

/**
* Executes the given command using the shell in the supplied execution
* directory.
* directory. Normally this would be executed in a unix-like environment.
* In Windows this would be from something like a Git-Bash shell.
*
* @param command The command to run
* @param edir The directory in which to run the command
* (execution directory)
* @param pin The pipeline input directory
* (used to define the PIN environment variable)
* @param pout The pipeline output directory
Expand All @@ -43,6 +45,16 @@ class ShellExecutor {

StringBuilder sout = new StringBuilder()
StringBuilder serr = new StringBuilder()

// Windows/Git-Bash PIN/POUT path tweak...
String osName = System.properties['os.name']
if (osName && osName.startsWith('Win')) {
pin = pin.replace('\\', '/')
pin = pin.replace('C:', '/c')
pout = pout.replace('\\', '/')
pout = pout.replace('C:', '/c')
}

// Append '/' to PIN and POUT to allow '${POUT}output'
String cmd = "PIN=$pin/; POUT=$pout/; " + command
def proc = ['sh', '-c', cmd].execute(null, edir)
Expand Down