私は Cloudbees を初めて使用し、ローカルの Jenkins でスムーズに実行されるのとまったく同じテストが、実際には Cloudbees の Jenkins でエラーになっていることに気付きました...
基本的に、Mockito に基づくすべての単体テストは、Hibernate/Persistence を使用しようとして、次の例外が発生します。
Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
ローカル マシンで合格するテストが、Cloudbees ではエラーになります...
理由はわかりません。誰でも助けてもらえますか?
edit : Jenkins からの完全なスタック トレース:
Tests in error:
modifyChildminderAdvertisementShouldHaveNormalInteractions(com.bignibou.tests.service.advertisement.AdvertisementManagementTest)
shouldContainCorrectNumberOfDayToTimeSlots(com.bignibou.tests.service.advertisement.RegularDayToTimeSlotsTest): Failed to load ApplicationContext
shouldNotContainSaturdayNorSunday(com.bignibou.tests.service.advertisement.RegularDayToTimeSlotsTest): Failed to load ApplicationContext
shouldNotContainEveningNorNighttime(com.bignibou.tests.service.advertisement.RegularDayToTimeSlotsTest): Failed to load ApplicationContext
signupMemberShouldHaveNormalInteractions(com.bignibou.tests.service.signup.SignupServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
signupMemberShouldThrowIllegalArgumentExceptionIfAddressRefenceIsEmpty(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
activateMemberShouldThrowIllegalArgumentExceptionIfTokenIsEmpty(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
signupMemberShouldThrowIllegalArgumentExceptionIfAddressRefenceIsNull(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
activateMemberShouldThrowIllegalArgumentExceptionIfTokenIsNull(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
activateMemberShouldHaveNormalInteractions(com.bignibou.tests.service.signup.SignupServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
activateMemberShouldThrowInvalidTokenExceptionIfTokenIsInvalid(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<com.bignibou.InvalidTokenException> but was<org.springframework.transaction.CannotCreateTransactionException>
signupMemberShouldThrowIllegalArgumentExceptionIfMemberIsNull(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
signupMemberShouldRethrowMailerExceptionIfMessagingExceptionIsThrown(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<com.bignibou.MailerException> but was<org.springframework.transaction.CannotCreateTransactionException>
activateMemberShouldThrowMailerExceptionIfMessagingExceptionIsThrown(com.bignibou.tests.service.signup.SignupServiceTest): Unexpected exception, expected<com.bignibou.MailerException> but was<org.springframework.transaction.CannotCreateTransactionException>
resendActivationEmailShouldHaveNormalInteractions(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
sendPasswordResetInfoShouldHaveNormalInteractions(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
modifyEmailShouldThrowIllegalArgumentExceptionIfMemberArgumentIsNull(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
resendActivationEmailShouldThrowInvalidTokenException(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<com.bignibou.InvalidTokenException> but was<org.springframework.transaction.CannotCreateTransactionException>
modifyEmailShouldSetRelevantPropertiesToMember(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
emailShouldNotBeAvailable(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
activateEmailShouldHaveNormalInteractions(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
shouldActivateEmail(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
modifyEmailShouldThrowIllegalArgumentExceptionIfEmailArgumentIsEmpty(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
activateEmailShouldThrowIllegalArgumentExceptionIfTokenArgumentIsNull(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
modifyEmailShouldHaveNormalInteractions(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
emailShouldBeAvailable(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
modifyAddressShouldAllowMemberWithNoAddress(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
modifyPasswordShouldHaveNormalInteractions(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
shouldThrowMailerException(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<com.bignibou.MailerException> but was<org.springframework.transaction.CannotCreateTransactionException>
sendPasswordResetInfoShouldNotAllowInexistentEmail(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
shouldThrowInvalidTokenException(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<com.bignibou.InvalidTokenException> but was<org.springframework.transaction.CannotCreateTransactionException>
saveAddressFromReferenceShouldHaveNormalInteractions(com.bignibou.tests.service.preference.PreferenceServiceTest): Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
modifyEmailShouldThrowIllegalArgumentExceptionIfEmailArgumentIsNull(com.bignibou.tests.service.preference.PreferenceServiceTest): Unexpected exception, expected<java.lang.IllegalArgumentException> but was<org.springframework.transaction.CannotCreateTransactionException>
testPerformChildminderAdvertisementSearch(com.bignibou.tests.repository.advertisement.ChildminderAdvertisementIntegrationTest): Failed to load ApplicationContext
shouldAllow(com.bignibou.tests.controller.advertisement.AdvertisementControllerTest): Request processing failed; nested exception is java.lang.NullPointerException
shouldNotAllow(com.bignibou.tests.controller.advertisement.AdvertisementControllerTest): Request processing failed; nested exception is java.lang.NullPointerException
Tests run: 55, Failures: 8, Errors: 36, Skipped: 1