3

My setup includes Travis-ci, Jacoco plugin via maven pom, Codecov and Java10. When trying to setup the code coverage functionality travis-ci outputs an syntax error when evaluating the codecov-bash script (see the last 2 lines in Travis ci output)

.travis.yml

language: java
jdk: oraclejdk10
after_success:
- bash <(curl -s https://codecov.io/bash)

pom.xml

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.8.2</version>
    <executions>
        <execution>
        <goals>
            <goal>prepare-agent</goal>
        </goals>
        </execution>
        <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
                <goal>report</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Travis ci output

[INFO] Results:
[INFO] 
[WARNING] Tests run: 174, Failures: 0, Errors: 0, Skipped: 7
[INFO] 
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.2:report (report) @ PROJECT ---
[INFO] Loading execution data file /home/travis/build/x/y/target/jacoco.exec
[INFO] Analyzed bundle 'PROJECT' with 14 classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.121 s
[INFO] Finished at: 2018-09-20T20:25:14Z
[INFO] Final Memory: 18M/512M
[INFO] ------------------------------------------------------------------------
The command "mvn test -B" exited with 0.
after_success
0.00s$ bash < (curl -s https://codecov.io/bash)
/home/travis/.travis/job_stages: eval: line 98: syntax error near unexpected token `('
/home/travis/.travis/job_stages: eval: line 98: `bash < (curl -s https://codecov.io/bash) '
Done. Your build exited with 0.

I read about every single article on how to setup codecov with jacoco and travis ci, made a detour via cobertura just to figure out that Java10 is not supported and read change logs to see if some versions are uncompatible.

Did I make any mistakes configuring my build or is codecov-bash at fault? When running mvn:test locally I do get the expected jacoco.csv, jacoco.xml and index.html files.

Kilian
  • 1,540
  • 16
  • 28
  • 1
    The error comes from this line in your log: `0.00s$ bash < (curl -s https://codecov.io/bash)`. Apparently Travis adds a space between `<` and `(` in your command `bash <(curl -s https://codecov.io/bash)`. However I don't know why.. – Maël Pedretti Oct 02 '18 at 09:58
  • 1
    @MaëlPedretti Thank you. that is a good starting point for investigation. – Kilian Oct 02 '18 at 10:00
  • 1
    Could you post the link to your github repo? I want to give a deeper look during my lunch break – Maël Pedretti Oct 02 '18 at 10:01
  • https://github.com/KilianB/pcg-java . Thank you very much – Kilian Oct 02 '18 at 10:04
  • 1
    https://codecov.io/github/KilianB/pcg-java/commit/95c9affe6aac63d24371521aa9505b890e720911 https://travis-ci.org/KilianB/pcg-java/builds/433021500#L1837 Apparently it works – Maël Pedretti Oct 02 '18 at 10:08

0 Answers0