Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade embedded-postgres plugin and binaries. #1262

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
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
42 changes: 42 additions & 0 deletions .github/workflows/testing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,48 @@ jobs:
chown -R aswfuser:aswfgroup .
su -c "cd cuebot && ./gradlew build --stacktrace --info" aswfuser

test_cuebot_windows:
name: Build Cuebot and Run Unit Tests (Windows)
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Build with Gradle
run: |
cd cuebot
java -version
.\gradlew.bat build --stacktrace --info
- name: List pg files
if: ${{ always() }}
run: |
ls C:/Users/runneradmin/AppData/Local/Temp/embedded-pg
- name: Run initdb
if: ${{ always() }}
run: |
C:/Users/runneradmin/AppData/Local/Temp/embedded-pg/PG-*/bin/initdb.exe -A trust -U postgres -D C:/Users/runneradmin/AppData/Local/Temp/epg-foo -E UTF-8
- name: List pg files 2
if: ${{ always() }}
run: |
ls C:/Users/runneradmin/AppData/Local/Temp/epg-foo

test_cuebot_mac:
name: Build Cuebot and Run Unit Tests (macOS)
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Build with Gradle
run: |
cd cuebot
java -version
./gradlew build --stacktrace --info

test_pyside6:
name: Run CueGUI Tests using PySide6
runs-on: ubuntu-latest
Expand Down
26 changes: 24 additions & 2 deletions cuebot/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.gradle.internal.os.OperatingSystem;

buildscript {
repositories {
Expand Down Expand Up @@ -25,6 +26,26 @@ targetCompatibility = 1.8

ext {
activemqVersion = '5.12.0'
postgresVersion = '15.2.0'
}
if (OperatingSystem.current().isLinux()) {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'ldd'
args = ['--version']
standardOutput = os
}
def outputAsString = os.toString()
def matchGlibcVersion = outputAsString =~ /ldd \(.*\) ([\d.]+)/
List glibcVersion = matchGlibcVersion[0][1].tokenize('.')
def glibcMajorVersion = glibcVersion[0].toInteger()
def glibcMinorVersion = glibcVersion[1].toInteger()
// Need Glibc 2.25 to use the latest Postgres binaries.
if (glibcMajorVersion < 2 || (glibcMajorVersion == 2 && glibcMinorVersion < 25)) {
println "Glibc Version ${matchGlibcVersion[0][1]} is too low, downgrading Postgres dependency"
ext.postgresVersion = '15.1.0'
}
}
}

configurations {
Expand Down Expand Up @@ -64,11 +85,12 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0'
testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '1.3.1'
testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '2.0.2'
testCompile group: 'io.zonky.test.postgres', name: 'embedded-postgres-binaries-linux-arm64v8', version: postgresVersion
testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0'

// Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:11.13.0')
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:' + postgresVersion)
}

compileJava {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public boolean increaseReservedMemory(ProcInterface p, long value) {
"AND " +
"proc.int_mem_reserved != 0 " +
"ORDER BY " +
"proc.int_virt_used / proc.int_mem_pre_reserved DESC " +
"CAST(proc.int_virt_used AS numeric) / proc.int_mem_pre_reserved DESC " +
") AS t1 LIMIT 1";

@Override
Expand Down