Skip to content

Commit

Permalink
Refactor tests to optimize and fix performance issues cause by versio…
Browse files Browse the repository at this point in the history
…ning tests
  • Loading branch information
dima767 committed Jun 8, 2019
1 parent ee914e2 commit 7dab3e4
Show file tree
Hide file tree
Showing 6 changed files with 656 additions and 4 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import static edu.internet2.tier.shibboleth.admin.ui.repository.envers.EnversTes
@ContextConfiguration(classes = [CoreShibUiConfiguration, InternationalizationConfiguration, TestConfiguration, SearchConfiguration, EntitiesVersioningConfiguration])
@EnableJpaRepositories(basePackages = ["edu.internet2.tier.shibboleth.admin.ui"])
@EntityScan("edu.internet2.tier.shibboleth.admin.ui")
//@Ignore
@Ignore
class EnversEntityDescriptorVersionServiceTests extends Specification {

@Autowired
Expand Down
34 changes: 34 additions & 0 deletions envers-tests-module/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
id 'groovy'
id 'jacoco'
id 'org.springframework.boot' version '2.0.0.RELEASE' apply false
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
jcenter()
maven {
url 'https://build.shibboleth.net/nexus/content/groups/public'
artifactUrls = ['https://build.shibboleth.net/nexus/content/repositories/thirdparty-snapshots']
}
}

dependencyManagement {
imports {
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
}
}

dependencies {

compile project(':backend')
//testCompile project(':backend')
testCompile project(':backend').sourceSets.test.output
//testCompile "org.springframework.boot:spring-boot-starter-data-jpa"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.spockframework:spock-core:1.1-groovy-2.4"
testCompile "org.spockframework:spock-spring:1.1-groovy-2.4"
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import edu.internet2.tier.shibboleth.admin.ui.service.EntityDescriptorService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest

import org.springframework.data.jpa.repository.config.EnableJpaRepositories
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.ContextConfiguration
Expand All @@ -29,11 +30,11 @@ import static org.opensaml.saml.saml2.metadata.ContactPersonTypeEnumeration.OTHE
* Testing entity descriptor envers versioning
*/
@DataJpaTest
@ContextConfiguration(classes = [CoreShibUiConfiguration, InternationalizationConfiguration, TestConfiguration, SearchConfiguration])
@ContextConfiguration(classes = [CoreShibUiConfiguration, InternationalizationConfiguration, SearchConfiguration, TestConfiguration])
@EnableJpaRepositories(basePackages = ["edu.internet2.tier.shibboleth.admin.ui"])
@EntityScan("edu.internet2.tier.shibboleth.admin.ui")
//@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
@Ignore
//@Ignore
class EntityDescriptorEnversVersioningTests extends Specification {

@Autowired
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include 'backend', 'ui', 'pac4j-module'
include 'backend', 'ui', 'pac4j-module', 'envers-tests-module'

0 comments on commit 7dab3e4

Please sign in to comment.