Re: testutils + GitHub action -> fail

Claude Warren <[email protected]>
Newsgroups gmane.comp.jakarta.ant.devel
Message-ID <CAOQrJk7=o-JE0g32FJTfz4XnaaxtPFdonnYJSBUxE2zm_rTvPw@mail.gmail.com>
Yes it works on windows and linux if the linux is not on github.

LinkedIn: http://www.linkedin.com/in/claudewarren

On Sat 13 Sept 2025, 11:47 Stefan Bodewig, <[email protected]> wrote:

> Hi Claude
>
> I must admit I haven't got any idea. I've just checked out RAT's master
> (the PR has been merged) and the test worked fine on my Ubuntu machine.
>
> I see you have disabled the test by now, but in my case GITHUB_ACTION is
> not set so the test is executed.
>
> Cheers
>
>         Stefan
>
> On 2025-09-06, Claude Warren wrote:
>
> > Greetings,
>
> > I am working on the next iteration of RAT and have encountered a rather
> > strange problem.  I don't know that this is an Ant issue but this seems
> > like a reasonable place to ask.
>
> > RAT has an Ant task that we ship.  In testing for that task we use the
> > testutils package.
>
> > RAT is built using Maven.  We use the Junit 5 framework.  The test class
> > contains @TempDir annotated path called "testDir".
>
>
> >    1. We create an Antfile in the testDir.
> >    2. We instantiate a BuildFIleRule called "buildRule".
> >    3. We call buildRule.configureProject(antFile.getPath()).
>
>
> > The result is an exception when the Project.setBaseDir() is called and
> > fails with a "directory does not exist" error (see call stack below).
>
> >    - This code works on my local Linux system.
> >    - This code works on GitHub windows systems under Java 8, 11 and 21.
> >    - This code fails on GitHub Linux systems under Java 8, 11 and 21.
>
> > I have verified that before the call to "configureProject":
>
> >    - The tempDir exists.
> >    - The antFile exists and is in the tempDir.
> >    - The System property "TEST_ROOT_DIRECTORY" is not set, and returns
> null.
>
> > Does anyone know why this might fail under GitHub linux?  My thought is
> > that GitHub redirects the temp to be a directory on a virtual system and
> > that somehow the testutils is managing to escape the virtual system.
>
> > Any assistance is appreciated,
> > Claude
>
> > GitHub
> > OS: ubuntu_latest & windows_latest
> > java 8, 11, 21  (temurin)
>
> > Versions:
> > Ant 1.10.15
> > Antunit 1.4.1
> > Ant launcher 1.10.15
> > Ant testutils 1.10.15
>
> > Junit 5.13.4
> > maven antrun plugin 3.1.0 with Ant 1.10.15 dependency
>
> > Example project:
> > https://github.com/Claudenw/creadur-rat/tree/RAT-474_fix_Eclipse_import
>
> > Example PR exhibiting error:
> > https://github.com/apache/creadur-rat/pull/505
>
> > Call stack:
> > Basedir /tmp/junit-13375102842827554728 does not exist
> > at org.apache.tools.ant.Project.setBaseDir(Project.java:858)
> > at org.apache.tools.ant.Project.setBasedir(Project.java:843)
> > at
> >
> org.apache.tools.ant.helper.ProjectHelper2$ProjectHandler.onStartElement(ProjectHelper2.java:824)
>
> > at
> >
> org.apache.tools.ant.helper.ProjectHelper2$RootHandler.startElement(ProjectHelper2.java:575)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3063)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:836)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
>
> > at
> >
> java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
>
> > at
> > org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:280)
> > at
> > org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:182)
> > at
> >
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:104)
> > at
> >
> org.apache.tools.ant.BuildFileRule.configureProject(BuildFileRule.java:165)
> > at
> >
> org.apache.tools.ant.BuildFileRule.configureProject(BuildFileRule.java:143)
> > at
> >
> org.apache.rat.anttasks.AbstractRatAntTaskTest.setUp(AbstractRatAntTaskTest.java:44)
>
> > at
> >
> org.apache.rat.anttasks.ReportOptionTest$AntOptionsProvider$BuildTask.setUp(ReportOptionTest.java:166)
>
> > at
> >
> org.apache.rat.anttasks.ReportOptionTest$AntOptionsProvider.generateConfig(ReportOptionTest.java:89)
>
> > at
> >
> org.apache.rat.test.AbstractOptionsProvider.generateConfig(AbstractOptionsProvider.java:220)
>
> > at
> >
> org.apache.rat.test.AbstractOptionsProvider.configTest(AbstractOptionsProvider.java:643)
>
> > at
> >
> org.apache.rat.test.AbstractOptionsProvider.configTest(AbstractOptionsProvider.java:666)
>
> > at
> >
> org.apache.rat.anttasks.ReportOptionTest.testOptionsUpdateConfig(ReportOptionTest.java:68)
>
> > at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> > at java.base/java.util.Optional.ifPresent(Optional.java:183)
> > at
> >
> java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
>
> > at
> >
> java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
>
> > at
> >
> java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
>
> > at
> >
> java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
>
> > at
> >
> java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
>
> > at
> >
> java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
>
> > at
> >
> java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
>
> > at
> >
> java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>
> > at
> >
> java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
>
> > at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
> > at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.