Giter Site home page Giter Site logo

Comments (9)

nidi3 avatar nidi3 commented on May 25, 2024

Hm, what's your setup?
I can run e.g. the project's own tests in maven and in intellij and they both work.

from code-assert.

axelfontaine avatar axelfontaine commented on May 25, 2024

Versions

  • Maven 3.5.0
  • IntelliJ 2017.2.3
  • code-assert 0.0.13

Working directory when running tests

  • Maven always uses the current module root as the working directory.
  • IntelliJ uses the project root as the working directing.

AnalyzerConfig.maven().main()

  • Maven full build: works
  • Maven module build: works
  • IntelliJ: breaks with Invalid directory or JAR file: target/classes

AnalyzerConfig.maven(module).main()

  • Maven full build: breaks with Invalid directory or JAR file: mymodule/target/classes
  • Maven module build: breaks with Invalid directory or JAR file: mymodule/target/classes
  • IntelliJ: works

One more thing in case this helps: my base test case is in a separate testmodule which is added in test scope to every other module which then contains its own subclass with the rules for that module.

from code-assert.

nidi3 avatar nidi3 commented on May 25, 2024

Are you using windows?
There is already a check, but probably not os-safe.

from code-assert.

axelfontaine avatar axelfontaine commented on May 25, 2024

Yes, Win 10 x64

from code-assert.

nidi3 avatar nidi3 commented on May 25, 2024

Should be fixed in 0.8.1

from code-assert.

axelfontaine avatar axelfontaine commented on May 25, 2024

This appears to still be broken in IntelliJ with 0.8.2. I still need to use my workaround with that version.

from code-assert.

nidi3 avatar nidi3 commented on May 25, 2024

I still cannot reproduce the error.
The check is here:

return new File("").getAbsoluteFile().getName().equals(module);

Could you try and see what's going on? Thanks!

from code-assert.

axelfontaine avatar axelfontaine commented on May 25, 2024

Upon further testing, AnalyzerConfig.maven(module).main() now works both in Maven and IntelliJ.

AnalyzerConfig.maven().main() remains broken in IntelliJ, but in a different way: nothing is found! In this case the runningInModuleDir() method you mentioned also is not called.

from code-assert.

nidi3 avatar nidi3 commented on May 25, 2024

In this case, I guess, the working dir is the project root. Without a given module, how can it know the correct dir?
Btw I still cannot reproduce this. How exactly do you run the test with IntelliJ so that the working dir is not the module dir?

from code-assert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.