move rust test back into mysql client integrations job

This commit is contained in:
Stephanie You
2023-05-23 11:29:05 -07:00
parent bcf000aafd
commit 99bd6d36fe
6 changed files with 4 additions and 167 deletions
@@ -1,5 +0,0 @@
name: 'Dolt Rust MySQL client integration test'
description: 'Smoke test for rust mysql client integration'
runs:
using: 'docker'
image: '../../../integration-tests/RustDockerfile'
@@ -1,24 +0,0 @@
name: Test Rust MySQL Client integrations
on:
pull_request:
paths:
- 'go/**'
- 'integration-tests/**'
concurrency:
group: ci-rust-mysql-client-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
mysql_client_integrations_job:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Run test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Copy go package
run: cp -r ./go ./integration-tests/go
- name: Test rust mysql client integrations
uses: ./.github/actions/rust-client-test
-101
View File
@@ -1,101 +0,0 @@
FROM --platform=linux/amd64 ubuntu:20.04
# install python, libmysqlclient-dev, java, bats, git ruby, perl, cpan
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y && \
apt install -y \
curl \
gnupg \
libwxbase3.0-0v5 \
libwxgtk3.0-gtk3-0v5 \
libncurses5 \
libsctp1 \
software-properties-common && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
add-apt-repository ppa:deadsnakes/ppa -y && \
curl -OL https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_22.3.4.9-1~ubuntu~focal_amd64.deb && \
dpkg -i esl-erlang_22.3.4.9-1~ubuntu~focal_amd64.deb && \
curl -LO https://packages.erlang-solutions.com/erlang/debian/pool/elixir_1.10.2-1~ubuntu~focal_all.deb && \
dpkg -i elixir_1.10.2-1~ubuntu~focal_all.deb
RUN apt update -y && \
apt install -y \
curl \
wget \
pkg-config \
mysql-client \
libmysqlclient-dev \
openjdk-17-jdk \
ant \
ca-certificates-java \
bats \
cpanminus \
cmake \
g++ \
libmysqlcppconn-dev \
git \
gem \
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \
postgresql \
postgresql-contrib \
libpq-dev \
lsof \
postgresql-server-dev-all && \
update-ca-certificates -f
# install go
WORKDIR /root
ENV GO_VERSION=1.19
ENV GOPATH=$HOME/go
ENV PATH=$PATH:$GOPATH/bin
ENV PATH=$PATH:$GOPATH/bin:/usr/local/go/bin
RUN curl -O "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" && \
sha256sum "go${GO_VERSION}.linux-amd64.tar.gz" && \
tar -xvf "go${GO_VERSION}.linux-amd64.tar.gz" -C /usr/local && \
chown -R root:root /usr/local/go && \
mkdir -p $HOME/go/{bin,src} && \
go version
# install MySQL dependency from source
RUN git clone https://github.com/go-sql-driver/mysql.git
WORKDIR mysql
RUN git checkout tags/v1.6.0 -b v1.6.0
RUN go install .
WORKDIR /
# install rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
ENV PATH="/root/.cargo/bin:${PATH}"
# install postgres and psql
RUN service postgresql start
# install mysql_fdw
WORKDIR /mysql-client-tests/mysql_fdw
RUN git clone https://github.com/EnterpriseDB/mysql_fdw --branch REL-2_9_0
WORKDIR /mysql-client-tests/mysql_fdw/mysql_fdw
RUN make USE_PGXS=1 && \
make USE_PGXS=1 install
# install dolt from source
WORKDIR /root/building
COPY ./go .
ENV GOFLAGS="-mod=readonly"
RUN go build -o /usr/local/bin/dolt ./cmd/dolt
COPY mysql-client-tests /mysql-client-tests
COPY mysql-client-tests/rust-client-test-entrypoint.sh /mysql-client-tests/entrypoint.sh
# install rust dependencies
WORKDIR /mysql-client-tests/rust
RUN cargo build --config net.git-fetch-with-cli=true
WORKDIR /mysql-client-tests
ENTRYPOINT ["/mysql-client-tests/entrypoint.sh"]
RUN rustup show
@@ -162,8 +162,8 @@ EOF" -m "postgres"
Rscript $BATS_TEST_DIRNAME/r/rmariadb-test.r $USER $PORT $REPO_NAME
}
#@test "rust mysql.connector client" {
# cd $BATS_TEST_DIRNAME/rust
# cargo run --bin mysql_connector_test $USER $PORT $REPO_NAME
#}
@test "rust mysql.connector client" {
cd $BATS_TEST_DIRNAME/rust
cargo run --bin mysql_connector_test $USER $PORT $REPO_NAME
}
@@ -1,10 +0,0 @@
#!/bin/sh
echo "Updating dolt config for tests:"
dolt config --global --add metrics.disabled true
dolt config --global --add metrics.host localhost
dolt config --global --add user.name mysql-test-runner
dolt config --global --add user.email mysql-test-runner@liquidata.co
echo "Running mysql-client-tests:"
bats /mysql-client-tests/rust-client-test.bats
@@ -1,23 +0,0 @@
#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helpers.bash
setup() {
setup_dolt_repo
}
teardown() {
cd ..
teardown_dolt_repo
# Check if postgresql is still running. If so stop it
active=$(service postgresql status)
if echo "$active" | grep "online"; then
service postgresql stop
fi
}
@test "rust mysql.connector client" {
cd $BATS_TEST_DIRNAME/rust
cargo run --bin mysql_connector_test $USER $PORT $REPO_NAME
}