eo icon indicating copy to clipboard operation
eo copied to clipboard

Test failure

Open kerelape opened this issue 3 years ago • 4 comments

mvn clean install -Pqulice fails on eo-maven-plugin. I didn't change any code, it's master branch

OS: MacOS 10.13.6 JDK: java version "18.0.2" 2022-07-19

[ERROR] Failures: 
[ERROR]   TranspileMojoTest.recompileIfModified:108 
Expected: a value greater than <1663426214000L>
     but: <1663426214000L> was equal to <1663426214000L>
[INFO] 
[ERROR] Tests run: 72, Failures: 1, Errors: 0, Skipped: 6

kerelape avatar Sep 17 '22 14:09 kerelape

@mximp please, take a look

yegor256 avatar Sep 18 '22 03:09 yegor256

@kerelape Can you please add the log of the TranspileMojoTest.recompileIfModified test: any errors or warnings in it? I didn't manage to reproduce it with my MacOS/JDK18

mximp avatar Sep 19 '22 09:09 mximp

@mximp log.txt

kerelape avatar Sep 20 '22 08:09 kerelape

@kerelape It looks like environmental issue specific to your env. There is a code in TranspileMojoTest.recompileIfModified:

final long before = java.toFile().lastModified();
Assertions.assertTrue(src.toFile().setLastModified(before + 1));
new Moja<>(TranspileMojo.class)
    .with("project", new MavenProjectStub())
    .with("targetDir", target.toFile())
    .with("generatedDir", generated.toFile())
    .with("foreign", foreign.toFile())
    .with("foreignFormat", "csv")
    .with("transpiled", transpiled.toFile())
    .with("transpiledFormat", "csv")
    .execute();
MatcherAssert.assertThat(
    java.toFile().lastModified(),
    Matchers.greaterThan(before)
);

Could you please try to debug/log the lastModified for src and java files right after row Assertions.assertTrue(src.toFile().setLastModified(before + 1)); as well as after .execute()

I can see in you log:

[INFO] org.eolang.maven.TranspileMojo: XMIR /var/folders/yk/k0kgbxqj7h32y7n8gfy818rm0000gn/T/junit16956724664881979618/target/03-optimize/foo/src.xmir (foo.src) were already transpiled to /var/folders/yk/k0kgbxqj7h32y7n8gfy818rm0000gn/T/junit16956724664881979618/target/06-transpile/foo/src.xmir

which means that for some reason setLastModified() call didn't succeed for src.
Can you run the test separately from within IntelliJ? Does it pass?

mximp avatar Sep 21 '22 05:09 mximp

@kerelape any luck?

mximp avatar Oct 10 '22 12:10 mximp

@mximp @kerelape still a bug or we can close this one?

yegor256 avatar Mar 05 '23 05:03 yegor256

@yegor256 @mximp unfortunately I can't verify it, since I'm no longer running macOS

kerelape avatar Mar 05 '23 10:03 kerelape

@mximp I guess we can close this one, since the build is clean for me and I'm with Java 19

yegor256 avatar Mar 05 '23 10:03 yegor256