Skip to content

Commit

Permalink
Merge branch 'release/4.7.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
olliefreeman committed Jul 1, 2021
2 parents fc4be97 + c8e3896 commit d9dff3a
Show file tree
Hide file tree
Showing 142 changed files with 2,752 additions and 812 deletions.
97 changes: 85 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ pipeline {
Unit Tests
*/
stage('Unit Tests') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew --build-cache test"
}
Expand All @@ -112,6 +118,12 @@ pipeline {
Integration Tests
*/
stage('Integration Tests') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh './gradlew --build-cache -Dgradle.integrationTest=true ' + [
'mdm-core',
Expand All @@ -138,6 +150,12 @@ pipeline {
Functional Tests
*/
stage('Functional Test: mdm-core') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-core:integrationTest"
}
Expand All @@ -148,6 +166,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-authentication-apikey') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-authentication-apikey:integrationTest"
}
Expand All @@ -158,6 +182,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-authentication-basic') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-authentication-basic:integrationTest"
}
Expand All @@ -168,6 +198,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-dataflow') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-dataflow:integrationTest"
}
Expand All @@ -178,6 +214,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-datamodel') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-datamodel:integrationTest"
}
Expand All @@ -188,6 +230,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-referencedata') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-referencedata:integrationTest"
}
Expand All @@ -198,6 +246,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-terminology') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-terminology:integrationTest"
}
Expand All @@ -208,6 +262,12 @@ pipeline {
}
}
stage('Functional Test: mdm-security') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-security:integrationTest"
}
Expand All @@ -218,6 +278,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-profile') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-profile:integrationTest"
}
Expand All @@ -228,6 +294,12 @@ pipeline {
}
}
stage('Functional Test: mdm-plugin-federation') {
// Dont run these on main branch
when {
not {
branch 'main'
}
}
steps {
sh "./gradlew -Dgradle.functionalTest=true :mdm-plugin-federation:integrationTest"
}
Expand Down Expand Up @@ -321,16 +393,16 @@ pipeline {
}
}
}
// stage('E2E Profile Functional Test') {
// steps {
// sh "./gradlew -Dgradle.test.package=profile :mdm-testing-functional:integrationTest"
// }
// post {
// always {
// junit allowEmptyResults: true, testResults: 'mdm-testing-functional/build/test-results/profile/*.xml'
// }
// }
// }
// stage('E2E Profile Functional Test') {
// steps {
// sh "./gradlew -Dgradle.test.package=profile :mdm-testing-functional:integrationTest"
// }
// post {
// always {
// junit allowEmptyResults: true, testResults: 'mdm-testing-functional/build/test-results/profile/*.xml'
// }
// }
// }

stage('Compile complete Test Report') {
steps {
Expand Down Expand Up @@ -359,7 +431,7 @@ pipeline {

stage('Sonarqube') {
when {
branch 'develop'
branch 'develop'
}
steps {
withSonarQubeEnv('JenkinsQube') {
Expand Down Expand Up @@ -395,7 +467,8 @@ pipeline {

publishCoverage adapters: [jacocoAdapter('**/reports/jacoco/jacocoTestReport.xml')]
outputTestResults()
jacoco classPattern: '**/build/classes', execPattern: '**/build/jacoco/*.exec', sourceInclusionPattern: '**/*.java,**/*.groovy', sourcePattern: '**/src/main/groovy,**/grails-app/controllers,**/grails-app/domain,**/grails-app/services,**/grails-app/utils'
jacoco classPattern: '**/build/classes', execPattern: '**/build/jacoco/*.exec', sourceInclusionPattern: '**/*.java,**/*.groovy',
sourcePattern: '**/src/main/groovy,**/grails-app/controllers,**/grails-app/domain,**/grails-app/services,**/grails-app/utils'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.log'
slackNotification()
zulipNotification(topic: 'mdm-core')
Expand Down
45 changes: 34 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import java.util.concurrent.TimeUnit
buildscript {
repositories {
mavenLocal()
maven { url 'https://jenkins.cs.ox.ac.uk/artifactory/plugins-snapshot' }
maven { url 'https://jenkins.cs.ox.ac.uk/artifactory/plugins-release' }
maven {url 'https://jenkins.cs.ox.ac.uk/artifactory/plugins-snapshot'}
maven {url 'https://jenkins.cs.ox.ac.uk/artifactory/plugins-release'}
jcenter()

}
Expand Down Expand Up @@ -70,7 +70,7 @@ check {
task('sysProps') {
group 'help'
doLast {
logger.quiet('{}', System.properties.collect { "${it.key}:${it.value}" }.sort().join('\n'))
logger.quiet('{}', System.properties.collect {"${it.key}:${it.value}"}.sort().join('\n'))
}
}

Expand Down Expand Up @@ -113,10 +113,10 @@ task rootTestReport(type: TestReport) {
destinationDir = file("${buildDir}/reports/tests")
testResultDirs = files("${buildDir}/test-results")
FileCollection testResultContentDir = files("${buildDir}/test-results")
outputs.upToDateWhen { false }
outputs.upToDateWhen {false}

doFirst {
(testResultContentDir.getAsFileTree().visit { FileVisitDetails details ->
(testResultContentDir.getAsFileTree().visit {FileVisitDetails details ->
if (details.directory && details.name == 'binary') {
logger.info("Reporting on ${details.path}")
reportOn files(details.file)
Expand Down Expand Up @@ -169,7 +169,7 @@ subprojects {
doLast {
if (project.hasProperty('dependencyManagement')) {
Map imported = dependencyManagement.importedProperties
logger.quiet 'Project :: {}\n {}', project.name, imported.collect { k, v -> "$k:$v" }.sort().join('\n ')
logger.quiet 'Project :: {}\n {}', project.name, imported.collect {k, v -> "$k:$v"}.sort().join('\n ')
}
}
}
Expand All @@ -184,14 +184,37 @@ subprojects {
}

afterEvaluate {
project.tasks.withType(Test) { testTask ->
project.tasks.withType(Test) {testTask ->
ignoreFailures = System.getenv().containsKey('JENKINS')
}

// Set<Project> dependencyProjects = collectProjectDependencies(project)
// if (dependencyProjects) {
// project.tasks.findByName('install').dependsOn dependencyProjects.collect { it.tasks.findByName('install') }
// }
// Set<Project> dependencyProjects = collectProjectDependencies(project)
// if (dependencyProjects) {
// project.tasks.findByName('install').dependsOn dependencyProjects.collect { it.tasks.findByName('install') }
// }
}
}

afterEvaluate {
/*
Massive hack to solve parallel task running for assetCompile task
Make sure that each task mustRunAfter another assetCompile task, this ensures none of them can run at the same time
We have to allow for project dependencies so make sure thats accounted for manually
*/
List<Task> assetCompileTasks = it.getTasksByName('assetCompile', true).toList().sort{it.path}

Task coreTask = assetCompileTasks.find {it.path.startsWith(':mdm-core')}
Task dataModelTask = assetCompileTasks.find {it.path.startsWith(':mdm-plugin-datamodel')}

assetCompileTasks.remove(coreTask)
assetCompileTasks.remove(dataModelTask)
dataModelTask.mustRunAfter coreTask
assetCompileTasks.each{
it.mustRunAfter coreTask, dataModelTask
}

for (int i = 1; i < assetCompileTasks.size(); i++) {
assetCompileTasks[i].mustRunAfter assetCompileTasks[i-1]
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Core Info
version=4.6.0
version=4.7.0
group=uk.ac.ox.softeng.maurodatamapper
# Gradle
gradleVersion=6.7.1
Expand All @@ -25,7 +25,7 @@ luceneVersion=5.5.5
commonsTextVersion=1.9
springBootVersion=2.1.17.RELEASE
jaxbApiVersion=2.3.1
assetPipelineVersion=3.2.4
assetPipelineVersion=3.3.2
guavaVersion=28.1-jre
antVersion=1.9.13
javaMailVersion=5.4.0
Expand Down
4 changes: 4 additions & 0 deletions mdm-core/grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ dataSource:
---
environments:
test:
maurodatamapper:
authority:
name: 'Test Authority'
url: 'http://localhost'
spring.flyway.enabled: false
database:
name: 'mdmTest'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" SCHEMA public;
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
UPDATE core.flyway_schema_history
SET checksum = 490568862
WHERE version = '1.7.0' AND
checksum = -1413608684
checksum = -1413608684;

DELETE
FROM core.flyway_schema_history
WHERE version = '2.10.0' AND
description = 'update database metadata values';
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ class Authority implements InformationAware, CreatorAware, SecurableResource {
String getDomainType() {
Authority.simpleName
}


@Override
String toString() {
"${label}@${url}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ClassifierService extends ContainerService<Classifier> {

@Override
List<Classifier> getAll(Collection<UUID> containerIds) {
Classifier.getAll(containerIds)
Classifier.getAll(containerIds).findAll().collect {unwrapIfProxy(it)}
}

@Override
Expand All @@ -79,14 +79,21 @@ class ClassifierService extends ContainerService<Classifier> {
Classifier.findAllByReadableByAuthenticatedUsers(true)
}

@Override
Classifier get(Serializable id) {
Classifier.get(id)
}

List<Classifier> list(Map pagination = [:]) {
@Override
List<Classifier> list(Map pagination) {
Classifier.list(pagination)
}

@Override
List<Classifier> list() {
Classifier.list().collect {unwrapIfProxy(it)}
}

@Override
List<Classifier> findAllContainersInside(UUID containerId) {
Classifier.findAllContainedInClassifierId(containerId)
Expand Down
Loading

0 comments on commit d9dff3a

Please sign in to comment.