This is an automated email from the ASF dual-hosted git repository.
linxinyuan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new 0d0345412d chore(ci): Add Mock DB and JOOQ Generation to CI (#3689)
0d0345412d is described below
commit 0d0345412d658d627216f486a8a1abeb3efd50f6
Author: Xinyuan Lin <[email protected]>
AuthorDate: Tue Aug 26 20:35:22 2025 -0700
chore(ci): Add Mock DB and JOOQ Generation to CI (#3689)
This PR introduces the following changes:
1. Adds a mock database for use in the CI environment.
2. Configures CI to generate JOOQ files before running tests.
We are planning to remove the JOOQ-generated files from the codebase.
However, the CI/CD pipeline currently relies on these files, and JOOQ
cannot regenerate them without a live database, which is not available
during CI/CD runs. This change addresses that limitation.
Additionally, the default configuration is updated to use the password
`postgres` instead of an empty string. This change is necessary because
the CI database does not permit empty passwords. It has no impact on
development or production environments, as developers and deployment
will override this default with their own credentials.
Closes issue #3688.
---
.github/workflows/github-action-build.yml | 40 +++++++++++++++++++++--------
core/config/src/main/resources/storage.conf | 4 +--
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/github-action-build.yml
b/.github/workflows/github-action-build.yml
index 237a2f281f..e9e2cbce80 100644
--- a/.github/workflows/github-action-build.yml
+++ b/.github/workflows/github-action-build.yml
@@ -79,34 +79,52 @@ jobs:
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M
-Dfile.encoding=UTF-8
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M
-Dfile.encoding=UTF-8
+
+ services:
+ postgres:
+ image: postgres
+ env:
+ POSTGRES_PASSWORD: postgres
+ ports:
+ - 5432:5432
+ # Add a health check so steps wait until Postgres is ready
+ options: >-
+ --health-cmd="pg_isready -U postgres"
+ --health-interval=10s
+ --health-timeout=5s
+ --health-retries=5
steps:
- - name: Prepare ENV
- run: sudo apt-get install libncurses5
- - name: Checkout Texera
- uses: actions/checkout@v2
- - name: Setup Java
- uses: actions/setup-java@v2
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Setup JDK
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
- java-version: ${{ matrix.java-version }}
+ java-version: 11
+ - name: Setup sbt launcher
+ uses: sbt/setup-sbt@v1
- uses: coursier/cache-action@v6
with:
extraSbtFiles: '["core/*.sbt", "core/project/**.{scala,sbt}",
"core/project/build.properties" ]'
- name: Lint with scalafmt
run: cd core && sbt scalafmtCheckAll
+ - name: Create Database
+ run: psql -h localhost -U postgres -f
deployment/k8s/texera-helmchart/files/texera_ddl.sql
+ env:
+ PGPASSWORD: postgres
+ - name: Jooq Code Generator
+ run: cd core && sbt "DAO/runMain
edu.uci.ics.texera.dao.JooqCodeGenerator"
- name: Compile with sbt
run: cd core && sbt clean package
- name: Run backend tests
run: cd core && sbt test
python_udf:
- runs-on: ${{ matrix.os }}
strategy:
matrix:
- os:
- - ubuntu-latest
+ os: [ ubuntu-latest ]
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
-
+ runs-on: ${{ matrix.os }}
steps:
- name: Checkout Texera
uses: actions/checkout@v2
diff --git a/core/config/src/main/resources/storage.conf
b/core/config/src/main/resources/storage.conf
index 276c1efad8..dfb6914e24 100644
--- a/core/config/src/main/resources/storage.conf
+++ b/core/config/src/main/resources/storage.conf
@@ -128,7 +128,7 @@ storage {
username = "postgres"
username = ${?STORAGE_JDBC_USERNAME}
- password = ""
+ password = "postgres"
password = ${?STORAGE_JDBC_PASSWORD}
}
-}
\ No newline at end of file
+}