quattor / maven-tools

Maven-based Build Tools
www.quattor.org
Apache License 2.0
3 stars 12 forks source link

test execution stalled if the associated pan template is not an object template #126

Closed jouvin closed 7 years ago

jouvin commented 7 years ago

Writing a unit test, I made a mistake and declared the pan template associated with the test (declared in use Quattor qw()) as a normal template rather than an object template. The result was that the test execution was blocked in or after the compilation (the last message displayed was DEBUG: Pan compiler called... and the test was never started (if the first line was a `$this_app->info(), nothing was displayed). I check that executed the reported pan command did complete successfully.

I don't know what could be done but it would be good to exit with an error rather than getting the test stucked when such a mistake is done.

stdweird commented 7 years ago

that's odd. failed compilations should give clear error.

stdweird commented 7 years ago

indeed, no clear error in this case

# VERBOSE template-library-core path found /home/stdweird/git/quattor/template-library-core
# DEBUG: Pan compiler called from directory /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/src/test/resources (proc panc --formats json --output-dir /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/test/profiles --include-path .:/home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/pan:/home/stdweird/git/quattor/template-library-core basic.pan) 
# execute command diff -u /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/test/cache/basic/global.lock -
# execute command diff -u /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/test/cache/basic/global.lock - no status set, using 0
# execute command diff -u /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/test/cache/basic/global.lock - no desired stdout set, using empty string
# execute command diff -u /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/test/cache/basic/global.lock - no desired stderr set, using empty string
Unable to fetch profile basic at /home/stdweird/git/quattor/configuration-modules-core/ncm-syslog/target/dependency/build-scripts/Test/Quattor.pm line 241.
BEGIN failed--compilation aborted at src/test/perl/configure.t line 6.
src/test/perl/configure.t .. 
stdweird commented 7 years ago

so one issue is clearly an panc issue: why does this compilation end with exitcode 0?

jouvin commented 7 years ago

No this is not a compilation issue. The template is fine. Just it is not declared as an object template. Because of this it seems that use Quattor qw(xxx) never returns (neither a success nor an error)...

stdweird commented 7 years ago

@jouvin so running panc on a non-object template is considered ok as a syntax check? it just seems a bit odd.

jouvin commented 7 years ago

Sure, I think you can compile whatever template is syntactically correct and has nothing unresolved. But I just checked and in this case, there is no output (json) file produced. I think this is the reason why use Quattor qw(xxx) never completes: it probably waits for the json file to appear. I don't know this part of the code: is there any possibility to have a timeout?

This is clearly annoying as it is quite difficult to diagnose... I loosed quite sometime before understanding the issue.

stdweird commented 7 years ago

it does not hang, it continues and then fails with some error that CCM can't find the json file. but this is fixed in #127, just waiting for merge and new release

jouvin commented 7 years ago

As for me, it never entered the main code (after the initial use). But thanks for the fix, I'll try to look at it tomorrow in more details.