Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/boot-integration-tests.yml

This file was deleted.

37 changes: 0 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens

import java.nio.file.Files
import java.nio.file.Path

buildscript {
apply(from: "dependencies.gradle")

Expand Down Expand Up @@ -205,40 +202,6 @@ tasks.register('integrationTest', Test) {
dependsOn subprojects.integrationTest
}

// Jacoco coverage reports:
//
// For unit test coverage (recommended):
// ./gradlew test jacocoTestReport
// Reports in each module: <module>/build/reports/jacoco/test/html/index.html
//
// For aggregated coverage across all modules:
// ./gradlew test jacocoAggregatedReport
// Report: build/reports/jacoco/jacocoAggregatedReport/html/index.html
//
// Note: Integration test coverage (jacocoIntegrationReport) requires running
// integration tests which need special setup (UAA server, database, LDAP).
// Use ./run-integration-tests.sh for that purpose.
tasks.register('jacocoCargoReport', JacocoReport) {
def javaProjects = subprojects.findAll {
it.pluginManager.hasPlugin('java')
}

// Collect execution data from all subprojects' integration tests
executionData(fileTree(layout.buildDirectory).include("jacoco/*.exec"))
javaProjects.each { subproject ->
executionData.from(fileTree(subproject.layout.buildDirectory).include("jacoco/integrationTest.exec"))
}

FileTree sourceTree = files().asFileTree
FileTree classTree = files().asFileTree
javaProjects.each {
sourceTree += it.sourceSets.main.allJava
classTree += it.sourceSets.main.output.asFileTree
}
additionalSourceDirs = sourceTree
additionalClassDirs = classTree
}

tasks.register('cleanBootTomcatDir') {
String tomcatBase = file("scripts/boot/tomcat/").getAbsolutePath()
delete(java.nio.file.Path.of(tomcatBase))
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ libraries.xmlUnit = "org.xmlunit:xmlunit-assertj"
libraries.springBootGradlePlugin = "org.springframework.boot:spring-boot-gradle-plugin:${versions.springBootVersion}"
libraries.springDependencyManagementGradlePlugin = "io.spring.gradle:dependency-management-plugin"
libraries.gradleJcocoPlugin = "org.barfuin.gradle.jacocolog:gradle-jacoco-log:3.1.0"
libraries.sonarqubePlugin = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:6.3.1.5724"
libraries.sonarqubePlugin = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:7.0.1.6134"
2 changes: 1 addition & 1 deletion scripts/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function main() {
local test_profile="${1:-hsqldb}"

setup_hosts_file
boot_db "${DB}" # DB is set in the Dockerfile for each image
boot_db "${DB:-hsqldb}" # DB is set in the Dockerfile for each image

pushd "$(dirname ${script_dir})"
start_ldap
Expand Down
8 changes: 6 additions & 2 deletions scripts/lib_db_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,17 @@ function boot_db() {
boot_log_location="/var/log/postgres-boot.log"
launch_db="(POSTGRES_HOST_AUTH_METHOD=trust docker-entrypoint.sh postgres -c 'max_connections=250' &> ${boot_log_location}) &"
test_connection="psql -h localhost -U postgres -c '\conninfo' &>/dev/null"
init_db="psql -c 'drop database if exists uaa;' -U postgres; psql -c 'create database uaa;' -U postgres; psql -c 'drop user if exists root;' --dbname=uaa -U postgres; psql -c \"create user root with superuser password '${db_password}';\" --dbname=uaa -U postgres; psql -c 'show max_connections;' --dbname=uaa -U postgres;"
init_db="psql -c 'drop database if exists uaa;' -h localhost -U postgres;
psql -c 'create database uaa;' -h localhost -U postgres;
psql -c 'drop user if exists root;' -h localhost --dbname=uaa -U postgres;
psql -c \"create user root with superuser password '${db_password}';\" -h localhost --dbname=uaa -U postgres;
psql -c 'show max_connections;' -h localhost --dbname=uaa -U postgres;"

# Override create_db function for PostgreSQL
function create_db() {
local database_name="uaa_${1}"
echo "Creating PostgreSQL database: ${database_name}"
psql -c "create database ${database_name};" -U postgres
psql -c "create database ${database_name};" -h localhost -U postgres
}

elif [[ "${db}" = "mysql" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions scripts/lib_ldap_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function start_ldap() {
start_ldap_oracle
update_ldif_paths_oracle
else
echo "LDAP setup could not be detected"
exit 1
echo "LDAP setup could not be detected, skipping"
return
fi
initialize_ldap
}
Expand Down
10 changes: 7 additions & 3 deletions scripts/lib_util_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function is_boot_running() {
start_time=$(date +%s)

while true; do
if grep -q "$target_line" "$log_file"; then
if grep "$target_line" "$log_file"; then
echo "Boot Start was found in the log file."
return 0
fi
Expand All @@ -37,7 +37,8 @@ function is_boot_running() {
##########################################
function setup_hosts_file() {

cat <<EOF >>/etc/hosts
if [[ -w "/etc/hosts" ]]; then
cat <<EOF >>/etc/hosts || true
127.0.0.1 testzone1.localhost
127.0.0.1 testzone2.localhost
127.0.0.1 testzone3.localhost
Expand All @@ -47,12 +48,15 @@ function setup_hosts_file() {
127.0.0.1 testzoneinactive.localhost
127.0.0.1 ldap01.example.com
EOF
fi
}

########################################
# Display memory of container
##########################################
function display_memory() {
grep MemTotal /proc/meminfo || true
if [[ -f "/proc/meminfo" ]]; then
grep MemTotal /proc/meminfo || true
fi
}

1 change: 1 addition & 0 deletions scripts/start_docker_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ main() {
"

docker pull "${DOCKER_IMAGE}"
set -x
docker run \
--privileged \
--tty \
Expand Down
11 changes: 3 additions & 8 deletions uaa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,12 @@ integrationTest {
project.logger.warn("UAA - Overriding SAML Url:"+samlUrl)
}

testLogging {
events("started", "passed", "skipped", "failed")
showStandardStreams = false
exceptionFormat = "full"
}

doFirst {
if (System.getProperty("skipUaaAutoStart", "false").toBoolean()) {
logger.lifecycle("Skipping UAA auto-start (skipUaaAutoStart=true)")
return
}

logger.lifecycle("Killing UAA before auto-start")
rootProject.tasks.named('killUaa').get().exec()

def bootPidFile = rootProject.file('build/boot.pid')
Expand Down Expand Up @@ -278,7 +272,8 @@ integrationTest {
}
Thread.sleep(1000)
}


logger.lifecycle("Killing UAA after failed auto-start")
rootProject.tasks.named('killUaa').get().exec()
throw new GradleException("UAA failed to start within ${maxWaitSeconds} seconds. Check ${bootLogFile.absolutePath}")
}
Expand Down
Loading