0

I am getting following error: Failed to execute goal [32morg.apache.maven.plugins:maven-failsafe-plugin:2.22.2:integration-test[m [1m(default-cli)[m on project [36madcallservice[m: [1;31m/apps/slave/workspace/ServiceDevIT/target/failsafe-reports/failsafe-summary.xml (No such file or directory)

Following is the set-up:

  1. I am running trying to run this on Jenkins node.
  2. Following is my docker-compose file:
version: '2'
services:
  redis:
    image: "redis:alpine"
    ports:
      - "6379:6379"
  web:
    depends_on:
      - redis
    build: .
    ports:
     - "8080:8080"
    environment:
     - SPRING_PROFILES_ACTIVE=test
     - ENVIRONMENT_NAME=test
  1. This is my shell script on jenkins :
    make build
    docker-compose build
    docker-compose up -d
    mvn failsafe:integration-test

I have included the following entry in my pom.xml:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/IT*.java</include>
            <include>**/*IT.java</include>
            <include>**/*ITCase.java</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <id>failsafe-integration-tests</id>
            <phase>integration-test</phase>
            <goals>
              <goal>integration-test</goal>
            </goals>
          </execution>
          <execution>
            <id>failsafe-verify</id>
            <phase>verify</phase>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Also, the integration tests are in file named ControllerIT.java

Prashant
  • 73
  • 1
  • 7
  • The service gets build fine, and both service and redis containers comes up. But, the integration-test step fails. Can someone please help in this regard. – Prashant Feb 26 '21 at 15:55
  • First calling only a goal for running integration tests like this: `mvn failsafe:integration-test` does not make sense.. just call `mvn verify` ... Furthermore Why are you configuring maven-failsafe-plugin with includes which are already the default furthermore you should use a up-to-date version of failsafe-plugin... and furthermore check the [usage page](https://maven.apache.org/surefire/maven-failsafe-plugin/usage.html) – khmarbaise Feb 26 '21 at 16:30
  • @khmarbaise : Thanks for the answer. Actually, these are the different things I tried during the course, and it is the current state. Here : https://stackoverflow.com/questions/9947701/failsafe-plugin-wont-run-on-one-project-but-will-run-on-another-why on stackoverlow, it was suggested to anyway include the default for failsafe as well. This is the original command which I want to execute, but not working : mvn failsafe:integration-test failsafe:verify surefire-report:failsafe-report-only – Prashant Feb 27 '21 at 01:22
  • also, ```mvn verify``` also leads to similar issue : permission denied. – Prashant Feb 27 '21 at 01:30
  • No that are not different things because that integrates all together. Furthermore The suggestion which you mentioned shows people have not understood the concept of convention over configuration. Please make a full working example on Github or a like and second remove at the first step all docker/docker-compose stuf from your commands just use a plain `mvn clean verify` ... afterwards we will take a look what the problem really. You have put "permission denied" in the title of the post but the output does not show a "permission denied" it shows "No such file or directory" which is different. – khmarbaise Feb 27 '21 at 11:11

0 Answers0