cuplv / biggroum

Top-level project for the graph extraction
Apache License 2.0
8 stars 2 forks source link

Biggroumscript.sh breaks the tests in python/fixrgraph/musedev/test. #64

Open smover opened 4 years ago

smover commented 4 years ago

The changes to the biggroumscript.sh breaks the tests in python/fixrgraph/musedev/test.

We were testing that the bash script was calling the python script correctly, but now the bash script became "path dependent" (e.g., biggroumsetup/biggroum and /root/biggroumsetup) and without a way to skip the setup process (we cannot test the script on mac anymore for example, because path are hardcoded and the update-alternative command that is always called).

The comment Note: Environment variable to determine run was difficult. docker does not run .bashrc on shell start, sourcing .bashrc in script also failed does not really explain why we switched from environment variables (which are quite easy to set when invoking the script, for local testing) to files, it just motivates a workaround.

Why does sourcing .bashrc file does not work? That seems to break the behavior of bash, while it should not be the case.

Here my main complaints:

You have the same issues for the other environment variables you keep setting:

export GRAPH_EXTRACTOR_PATH="${HOME}/biggroumsetup/fixrgraphextractor_2.12-0.1.0-one-jar.jar" >>setup_log 2>&1 && \
export PYTHONPATH="${HOME}/biggroumsetup/biggroum/python:$PYTHONPATH"  >>setup_log 2>&1

They were inside the setup first, under the assumption that the container was created fresh at every run. I would just export those environment variables in the setup and export them in the bashrc (and execute the bashrc every time), so we do not lose them and we can test the script locally.

I would also not change directory before invoking the biggroumscript.py, and I would use an environment variable telling where is the biggroum repository:

${BIGGROUMREPO}/python/fixrgraph/musedev/biggroumscript.py`

Originally posted by @smover in https://github.com/cuplv/biggroum/pull/60#issuecomment-558210250