diff --git a/.github/workflows/testing-pipeline.yml b/.github/workflows/testing-pipeline.yml index 7d2b59af9..6c8be14c1 100644 --- a/.github/workflows/testing-pipeline.yml +++ b/.github/workflows/testing-pipeline.yml @@ -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 diff --git a/cuebot/build.gradle b/cuebot/build.gradle index a9b7cfaa5..1a1d32080 100644 --- a/cuebot/build.gradle +++ b/cuebot/build.gradle @@ -1,3 +1,4 @@ +import org.gradle.internal.os.OperatingSystem; buildscript { repositories { @@ -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 { @@ -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 { diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java index 5af292fb3..0b957371f 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java @@ -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