Error with integration in Travis-CI

Rodrigo Batista

This is the error log:

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.01 s <<< FAILURE! - in com.rjdesenvolvimento.apipessoas.ApipessoasApplicationTests
[ERROR] contextLoads(com.rjdesenvolvimento.apipessoas.ApipessoasApplicationTests)  Time elapsed: 0.019 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
Caused by: org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
Caused by: org.postgresql.util.PSQLException: FATAL: database "aries" does not exist

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   ApipessoasApplicationTests.contextLoads » IllegalState Failed to 
load Applicat...
[INFO] 
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] --------------------------------------------------------------------- 
---
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------- 
--
[INFO] Total time: 19.751 s
[INFO] Finished at: 2018-08-03T03:26:16Z
[INFO] ---------------------------------------------------------------------- 
--
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire- 
plugin:2.21.0:test (default-test) on project apipessoas: There are test 
failures.
[ERROR] 
[ERROR] Please refer to 
/home/travis/build/rodrigodevelms/api_pessoas/target/surefire-reports for the 
individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, 
[date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The command "./mvnw test -B" exited with 1.
Done. Your build exited with 1.

Anyone can help me?

lealceldeiro

In your .travis.yml file add this configuration

sudo: enabled

addons:
  postgresql: "9.5" // change "9.5" for your postgres specific version

before_script:
  - psql -c "create database aries;" -U postgres // your database name
  - sudo -u postgres psql -c "ALTER ROLE postgres WITH password 'postgres'" // if your password is different from 'postgres` use that one here

services:
  - postgresql

You can take as reference this .travis.yml where I have set up this successfully.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related