conveyal / analysis-backend

Server component of Conveyal Analysis
http://conveyal.com/analysis
MIT License
23 stars 12 forks source link

Test that JARs produced by build are runnable #266

Closed abyrd closed 4 years ago

abyrd commented 4 years ago

This PR tests that the shadow JAR produced by the Github Actions build can actually be run without crashing.

There is a new config property "immediate-shutdown" which defaults to false, but if set to true will cause the JVM to exit with a success code as soon as our backend finishes starting up. Any errors that occur during startup are trapped and cause a JVM shutdown with a failure exit code.

To enable this, you can now set Conveyal backend configuration options via environment variables or the JVM command line. Our usual config properties are prefixed with "conveyal" in this context: system properties are specified on the JVM command line with -Dconveyal.config.key=value and environment variables are specified as CONVEYAL_CONFIG_KEY=value.

abyrd commented 4 years ago

Note that the failing check on this PR is the intended result. The build works, but it fails on the stage that tries to run the shadow JAR, and logs the stack trace that caused the failure.

abyrd commented 4 years ago

I updated the template config file to match our current set of options, and copy that template to the standard config file name before running the JAR check. It is now failing due to the ImageIO problem rather than a missing config file.