Skip to content

Commit

Permalink
Fix tests on jammy (#127)
Browse files Browse the repository at this point in the history
* Run tests on jammy

* supervisor fix

* fix type

---------

Co-authored-by: Aleksandr Shevchuk <[email protected]>
  • Loading branch information
noname0443 and Aleksandr Shevchuk authored Aug 30, 2024
1 parent 1cb0a25 commit dd7ca94
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-jepsen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
jobs:
test:
name: jepsen
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-tests-8.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
buildimages:
name: Build images
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
Expand All @@ -35,7 +35,7 @@ jobs:

test:
name: test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [ buildimages ]
strategy:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
buildimages:
name: Build images
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
Expand All @@ -35,7 +35,7 @@ jobs:

test:
name: test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [ buildimages ]
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
unittest:
name: all_unittests
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion tests/images/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:jammy
ENV container docker
ENV DEBIAN_FRONTEND noninteractive
ENV ZK_VERSION=3.7.1
Expand Down
61 changes: 30 additions & 31 deletions tests/images/base/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

set -xe

cat <<EOF > /etc/apt/apt.conf.d/01buildconfig
cat <<EOF >/etc/apt/apt.conf.d/01buildconfig
APT::Install-Recommends "0";
APT::Get::Assume-Yes "true";
APT::Install-Suggests "0";
Expand All @@ -10,41 +9,41 @@ EOF
apt-get update

apt-get install \
wget \
ca-certificates \
lsb-release \
gpg-agent \
apt-utils \
software-properties-common
wget \
ca-certificates \
lsb-release \
gpg-agent \
apt-utils \
software-properties-common

apt-key add - < /var/lib/dist/base/percona.gpg
add-apt-repository 'deb http://mirror.yandex.ru/mirrors/percona/percona/apt bionic main'
add-apt-repository 'deb http://mirror.yandex.ru/mirrors/percona/ps-80/apt bionic main'
apt-key add - </var/lib/dist/base/percona.gpg
add-apt-repository 'deb http://mirror.yandex.ru/mirrors/percona/percona/apt jammy main'
add-apt-repository 'deb http://mirror.yandex.ru/mirrors/percona/ps-80/apt jammy main'

# common
apt-get update
apt-get install \
apt-utils \
openjdk-11-jre-headless \
less \
bind9-host \
net-tools \
netcat \
iputils-ping \
sudo \
telnet \
git \
python3-pip \
python3-setuptools \
faketime \
rsync \
vim \
iptables
apt-utils \
openjdk-11-jre-headless \
less \
bind9-host \
net-tools \
netcat \
iputils-ping \
sudo \
telnet \
git \
python3-pip \
python3-setuptools \
faketime \
rsync \
vim \
iptables
rm -rf /var/run
ln -s /dev/shm /var/run

# ssh
apt-get install openssh-server
apt-get install openssh-server
mkdir -p /run/sshd
cp /var/lib/dist/base/sshd_config /etc/ssh/sshd_config
mkdir /root/.ssh
Expand All @@ -68,11 +67,11 @@ fi
rm -rf /var/lib/mysql/*

# supervisor
pip3 install git+https://github.com/Supervisor/supervisor.git@4619168a4d820b37641a4719e211cf867bd7f49d
pip3 install git+https://github.com/Supervisor/supervisor.git@18b59a1403778766561ab49b18cf2558e8a4d227
mkdir -p /etc/supervisor/conf.d
cp /var/lib/dist/base/supervisor.conf /etc/supervisor/supervisord.conf
cp /var/lib/dist/base/supervisor_ssh.conf /etc/supervisor/conf.d

# zookeeper
wget -nc -O - --quiet https://archive.apache.org/dist/zookeeper/zookeeper-${ZK_VERSION}/apache-zookeeper-${ZK_VERSION}-bin.tar.gz | tar -xz -C /opt && \
mv /opt/apache-zookeeper* /opt/zookeeper
wget -nc -O - --quiet https://archive.apache.org/dist/zookeeper/zookeeper-${ZK_VERSION}/apache-zookeeper-${ZK_VERSION}-bin.tar.gz | tar -xz -C /opt &&
mv /opt/apache-zookeeper* /opt/zookeeper
2 changes: 1 addition & 1 deletion tests/images/zookeeper/setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set -e

cp /var/lib/dist/zookeeper/supervisor_zookeeper.conf /etc/supervisor/conf.d
cp /var/lib/dist/zookeeper/supervisor_zookeeper.conf /etc/supervisor/conf.d
2 changes: 1 addition & 1 deletion tests/testutil/docker_composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func NewDockerComposer(project, config string) (*DockerComposer, error) {
project = filepath.Base(filepath.Dir(config))
}
dc := new(DockerComposer)
api, err := client.NewClientWithOpts(client.FromEnv)
api, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.43"))
if err != nil {
return nil, fmt.Errorf("failed to connect to docker: %s", err)
}
Expand Down

0 comments on commit dd7ca94

Please sign in to comment.