Skip to content

Commit

Permalink
add fixes to run regression tests in Docker container (#14)
Browse files Browse the repository at this point in the history
Removed useless commands from `concourse/scripts/entry.sh`, because our
docker images already have source of GPDB at `/home/gpadmin/gpdb_src`
and do not need to create or configure this directory.
Added file `arenadata/README.md` with information about how to run
tests at docker container.
Removed `--load-extension=diskquota_test` from `CMakeLists.txt` at regression
tests. Creating extension `diskquota_test` requires configured extension `diskquota`.
But `diskquota` is configured when `tests/regress/sql/config.sql` is executed, and
load-extension is done before this test is started. At all tests (where `diskquota_test`
is used) command `CREATE EXTENSION diskquota_test;` is executed.
  • Loading branch information
red1452 authored Apr 24, 2023
1 parent 472eb06 commit d5b5d1e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
28 changes: 28 additions & 0 deletions arenadata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Run regression tests in Docker container

You can build your Docker image from GPDB source or use prebuilt images from hub.adsw.io.
How to build Docker image: (["readme.md"](https://github.com/arenadata/gpdb/blob/f7ff7c8ecae4ce7ab3b73fd46171cdaa457b3591/arenadata/readme.md)).

1. Download the cmake-3.20 install script from ([source](https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_64.sh)).

2. Build diskquota in the Docker container.
Change <PATH_TO_DISKQUOTA_SRC> and <PATH_TO_CMAKE_INSTALL_SCRIPT> to the appropriate paths on your local machine.

```
docker run --rm -it -e DISKQUOTA_OS=rhel7 \
-v /tmp/diskquota_artifacts:/home/gpadmin/diskquota_artifacts \
-v <PATH_TO_DISKQUOTA_SRC>:/home/gpadmin/diskquota_src \
-v <PATH_TO_CMAKE_INSTALL_SCRIPT>:/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \
hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/entry.sh build
```

3. Run tests.
Change <PATH_TO_DISKQUOTA_SRC> and <PATH_TO_CMAKE_INSTALL_SCRIPT> to the appropriate paths on your local machine.

```
docker run --rm -it --sysctl 'kernel.sem=500 1024000 200 4096' \
-v /tmp/diskquota_artifacts:/home/gpadmin/bin_diskquota \
-v <PATH_TO_DISKQUOTA_SRC>:/home/gpadmin/diskquota_src \
-v <PATH_TO_CMAKE_INSTALL_SCRIPT>:/home/gpadmin/bin_cmake/cmake-3.20.0-linux-x86_64.sh \
hub.adsw.io/library/gpdb6_regress:latest diskquota_src/concourse/scripts/entry.sh test
```
15 changes: 1 addition & 14 deletions concourse/scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ setup_gpadmin() {
fi
mkdir -p /home/gpadmin
chown gpadmin:gpadmin /home/gpadmin

chown -R gpadmin:gpadmin /tmp/build
ln -s "${CONCOURSE_WORK_DIR}"/* /home/gpadmin
}

# Extract gpdb binary
function install_gpdb() {
[ ! -d /usr/local/greenplum-db-devel ] && mkdir -p /usr/local/greenplum-db-devel
tar -xzf "${CONCOURSE_WORK_DIR}"/bin_gpdb/*.tar.gz -C /usr/local/greenplum-db-devel
tar -xzf "${CONCOURSE_WORK_DIR}"/bin_gpdb/bin_gpdb.tar.gz -C /usr/local/greenplum-db-devel
chown -R gpadmin:gpadmin /usr/local/greenplum-db-devel
}

Expand All @@ -130,21 +127,11 @@ function create_fake_gpdb_src() {
grep -rhw '/usr/local/greenplum-db-devel' -e 'abs_top_srcdir = .*' |\
head -n 1 | awk '{ print $NF; }')"

if [ -d "${fake_gpdb_src}" ]; then
echo "Fake gpdb source directory has been configured."
return
fi

pushd /home/gpadmin/gpdb_src
./configure --prefix=/usr/local/greenplum-db-devel \
--without-zstd \
--disable-orca --disable-gpcloud --enable-debug-extensions
popd

local fake_root
fake_root=$(dirname "${fake_gpdb_src}")
mkdir -p "${fake_root}"
ln -s /home/gpadmin/gpdb_src "${fake_gpdb_src}"
}

# Setup common environment
Expand Down
1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ RegressTarget_Add(regress
SCHEDULE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/regress/diskquota_schedule${EXPECTED_DIR_SUFFIX}
REGRESS_OPTS
--load-extension=gp_inject_fault
--load-extension=diskquota_test
--dbname=contrib_regression)

RegressTarget_Add(isolation2
Expand Down

0 comments on commit d5b5d1e

Please sign in to comment.