Open dballardgh opened 6 years ago
Hi,
Just to provide more insights, I run on Windows 10 and only 1 test failed for me, and it is indeed the one related to basedir.
Results :
Failed tests: should_manage_relativebasedir(org.asciidoctor.ant.AsciidoctorAntTaskTest): (..)
Tests run: 12, Failures: 1, Errors: 0, Skipped: 0
Just a quick followup. When I clone to drive c:
and run the tests, I recreate @abelsromero's results with 12 run, 1 failure.
When I clone to drive f:
and run the tests, all 12 tests fail. In all cases, the test case cannot find the output files. The reason is that the tests are looking for the output files relative to junit's TemporaryFolder
(which looks like is based on window's TEMP
variable) on drive c:
:
C:\Users\dballard\AppData\Local\Temp\junit4654498160491557855\asciidoctor-twitter\twitter.html
However, asciidoctor is putting the output on current drive f:
:
F:\Users\dballard\AppData\Local\Temp\junit4654498160491557855\asciidoctor-twitter\twitter.html
I think this has something to do with asciidoctor's SAFE mode. I haven't quite figured out the semantics of SAFE mode yet. I did go into the ANT task and changed the safe mode to UNSAFE
as a test, and the problem disappears. The files are created on c:
as expected. Also as a test, changing TemporaryFolder()
to TemporaryFolder(new File("f:/tmp"))
corrected this problem, leaving only the originally reported baseDir
issue.
Can you try again ? I think it's fixed with 1.5.8 release 🤞
Hi @binout,
Currently on Win 10. I cloned the current tree and ran "mvn test". The compile is successful, but all of the tests fail with safe-mode problems such as:
SEVERE: (SecurityError) to_dir C:\Users\david\AppData\Local\Temp\junit3183025117078637188\asciidoctor is outside of jail: C:/ (disallowed in safe mode)
Perhaps this test output could be written to "target" rather than $TEMP?
Regards, Dave
Environment
F:\sandbox\asciidoctor-test
I've set up a directory structure as:
Scenario 1:
My
hello.ad
hasinclude::src/asciidoc/examples/myexample.ad[]
.My build.xml convert statement is:
Running the convert:
This works as expected and results in
target/hello.html
with included content.Scenario 2:
My
hello.ad
hasinclude::examples/myexample.ad[]
.Same convert configuration:
This logs a
WARNING
as expected, and createstarget/hello.html
with missing include.Scenario 3 (PROBLEM):
To allow the include to be found, I add
baseDir
to my convert statement:This appears to work as expected, with no WARNING. However the target directory is empty and the
hello.html
output file was created in thesrc
directory as:It does contain the expected include content. So it would appear that the actual output directory is the fully resolved
baseDir
plus the fully resolvedoutputDirectory
. I would expectbaseDir
not to affect the output directory.asciidoctor-ant test cases
I cloned the current
https://github.com/asciidoctor/asciidoctor-ant.git
and ran amvn test
. All 12 of the tests failed, some of which had the same target path problems as described above. So this may be a problem specific to running the convert on windows.Please let me know if I can provide additional information.