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

move main #221

Merged
merged 8 commits into from
May 3, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/ci-bats-unix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
- name: Install DoltgreSQL
working-directory: ./
run: |
go build -mod=readonly -o .ci_bin/doltgresql .
go build -mod=readonly -o .ci_bin/doltgres ./cmd/doltgres
- name: Setup DoltgreSQL Config
run: |
doltgresql config --global --add user.name 'Dolthub Actions'
doltgresql config --global --add user.email 'actions@dolthub.com'
doltgres config --global --add user.name 'Dolthub Actions'
doltgres config --global --add user.email 'actions@dolthub.com'
- name: Install PSQL Ubuntu
if: matrix.os == 'ubuntu-22.04'
run: |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion scripts/build_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ for tuple in $OS_ARCH_TUPLES; do
CC="${platform_cc[${tuple}]}" \
AS="${platform_as[${tuple}]}" \
CGO_LDFLAGS="${platform_cgo_ldflags[${tuple}]}" \
go build -buildvcs=false -trimpath -ldflags="${platform_go_ldflags[${tuple}]}" -o "$o/bin/$obin" .
cd cmd/doltgres
go build -buildvcs=false -trimpath -ldflags="${platform_go_ldflags[${tuple}]}" -o "../../$o/bin/$obin" .
cd ../..
done
if [ "$os" = windows ]; then
(cd out && 7z a "doltgresql-$os-$arch.zip" "doltgresql-$os-$arch" && 7z a "doltgresql-$os-$arch.7z" "doltgresql-$os-$arch")
Expand Down
9 changes: 5 additions & 4 deletions testing/ReplicationTestDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ RUN rm -rf ./doltgresql/testing/generation/
WORKDIR /root/building/doltgresql/postgres/parser
RUN bash ./build.sh

# Build the doltgresql binary, which we will need for bats, and put it on PATH
WORKDIR /root/building/doltgresql
# Build the doltgres binary, which we will need for bats, and put it on PATH
WORKDIR /root/building/doltgresql/cmd/doltgres
RUN go build .
RUN cp ./doltgresql /root/bin
RUN cp ./doltgresql /root/bin/doltgres
RUN cp ./doltgres /root/bin

WORKDIR /root/building/doltgresql/

# This env var is required to run the bats replication tests
ENV RUN_DOLTGRES_REPLICATION_TESTS=true
Expand Down
24 changes: 12 additions & 12 deletions testing/bats/setup/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ nativebatsdir() { echo `nativepath $BATS_TEST_DIRNAME/$1`; }
batshelper() { echo `nativebatsdir helper/$1`; }

stash_current_dolt_user() {
export STASHED_DOLT_USER_NAME=`doltgresql config --global --get user.name`
export STASHED_DOLT_USER_EMAIL=`doltgresql config --global --get user.email`
export STASHED_DOLT_USER_NAME=`doltgres config --global --get user.name`
export STASHED_DOLT_USER_EMAIL=`doltgres config --global --get user.email`
}

restore_stashed_dolt_user() {
doltgresql config --global --add user.name "$STASHED_DOLT_USER_NAME"
doltgresql config --global --add user.email "$STASHED_DOLT_USER_EMAIL"
doltgres config --global --add user.name "$STASHED_DOLT_USER_NAME"
doltgres config --global --add user.email "$STASHED_DOLT_USER_EMAIL"
unset STASHED_DOLT_USER_NAME STASHED_DOLT_USER_EMAIL
}

set_dolt_user() {
doltgresql config --global --add user.name "$1" > /dev/null 2>&1
doltgresql config --global --add user.email "$2" > /dev/null 2>&1
doltgres config --global --add user.name "$1" > /dev/null 2>&1
doltgres config --global --add user.email "$2" > /dev/null 2>&1
}

unset_dolt_user() {
doltgresql config --global --unset user.name
doltgresql config --global --unset user.email
doltgres config --global --unset user.name
doltgres config --global --unset user.email
}

current_dolt_user_name() {
doltgresql config --global --get user.name
doltgres config --global --get user.name
}

current_dolt_user_email() {
doltgresql config --global --get user.email
doltgres config --global --get user.email
}

setup_common() {
Expand All @@ -60,7 +60,7 @@ setup_common() {

mkdir "postgres"
cd "postgres"
doltgresql init
doltgres init
cd ..

if [ -z "$DOLT_TEST_RETRIES" ]; then
Expand Down Expand Up @@ -100,5 +100,5 @@ log_output_has() {
}

nativevar DOLT_ROOT_PATH $BATS_TMPDIR/config-$$ /p
doltgresql config --global --add metrics.disabled true > /dev/null 2>&1
doltgres config --global --add metrics.disabled true > /dev/null 2>&1
set_dolt_user "Bats Tests" "bats@email.fake"
8 changes: 4 additions & 4 deletions testing/bats/setup/query-server-common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ start_sql_server() {
PORT=$( definePORT )
if [[ $logFile ]]
then
doltgresql --host 0.0.0.0 --port=$PORT --data-dir=. --user "${SQL_USER:-postgres}" > $logFile 2>&1 &
doltgres --host 0.0.0.0 --port=$PORT --data-dir=. --user "${SQL_USER:-postgres}" > $logFile 2>&1 &
else
doltgresql --host 0.0.0.0 --port=$PORT --data-dir=. --user "${SQL_USER:-postgres}" &
doltgres --host 0.0.0.0 --port=$PORT --data-dir=. --user "${SQL_USER:-postgres}" &
fi
SERVER_PID=$!
wait_for_connection $PORT 7500
Expand All @@ -62,8 +62,8 @@ start_sql_server_with_args() {
set -- "$@" "--port" "$PORT"
fi

echo "running doltgresql $@"
doltgresql "$@" &
echo "running doltgres $@"
doltgres "$@" &
SERVER_PID=$!
wait_for_connection $PORT 7500
}
Expand Down