Skip to content

Commit

Permalink
fixup! [#641] Add rc binaries tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PruStephan committed Sep 5, 2023
1 parent 0f1b5d9 commit ba41c2e
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 50 deletions.
32 changes: 32 additions & 0 deletions binaries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"released": [
"tezos-client",
"tezos-admin-client",
"tezos-node",
"tezos-signer",
"tezos-codec",
"tezos-baker-PtMumbai",
"tezos-accuser-PtMumbai",
"tezos-smart-rollup-client-PtMumbai",
"tezos-smart-rollup-node-PtMumbai",
"tezos-baker-PtNairob",
"tezos-accuser-PtNairob",
"tezos-smart-rollup-client-PtNairob",
"tezos-smart-rollup-node-PtNairob"
],
"candidates": [
"tezos-client",
"tezos-admin-client",
"tezos-node",
"tezos-signer",
"tezos-codec",
"tezos-baker-PtMumbai",
"tezos-accuser-PtMumbai",
"tezos-smart-rollup-client-PtMumbai",
"tezos-smart-rollup-node-PtMumbai",
"tezos-baker-PtNairob",
"tezos-accuser-PtNairob",
"tezos-smart-rollup-client-PtNairob",
"tezos-smart-rollup-node-PtNairob"
]
}
9 changes: 6 additions & 3 deletions docker/tests/Dockerfile-fedora-test
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
ARG dist
FROM fedora:${dist}

ARG package

WORKDIR /tezos-packaging/docker

RUN dnf update -y
RUN dnf install -y python3-devel python3-setuptools 'dnf-command(copr)'
RUN sudo dnf copr enable -y @Serokell/${package}

ARG repo
RUN sudo dnf copr enable -y @Serokell/${repo}

ENV IS_RELEASED=${repo}

COPY docker/tests/test-fedora-binaries.py /tezos-packaging/docker/tests/test-fedora-binaries.py
COPY binaries.json /tezos-packaging/binaries.json
CMD [ "python3", "/tezos-packaging/docker/tests/test-fedora-binaries.py", "--no-cleanup" ]
9 changes: 6 additions & 3 deletions docker/tests/Dockerfile-ubuntu-test
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
ARG dist
FROM ubuntu:${dist}

ARG package

WORKDIR /tezos-packaging/docker

RUN apt update -y
RUN apt install -y python3-all python3-setuptools software-properties-common
RUN add-apt-repository -yu ppa:serokell/${package}

ARG repo
RUN add-apt-repository -yu ppa:serokell/${repo}

ENV IS_RELEASED=${repo}

COPY docker/tests/test-ubuntu-binaries.py /tezos-packaging/docker/tests/test-ubuntu-binaries.py
COPY binaries.json /tezos-packaging/binaries.json
CMD [ "python3", "/tezos-packaging/docker/tests/test-ubuntu-binaries.py", "--no-cleanup" ]
4 changes: 2 additions & 2 deletions docker/tests/scripts/test-fedora-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# SPDX-License-Identifier: LicenseRef-MIT-OA

for version in $(jq -r '.fedora[]' docker/supported_versions.json); do
docker build --build-arg dist="$version" --build-arg package="Tezos" -t fedora-test -f docker/tests/Dockerfile-fedora-test .
docker build --build-arg dist="$version" --build-arg repo="Tezos" -t fedora-test -f docker/tests/Dockerfile-fedora-test .
docker run fedora-test
docker build --build-arg dist="$version" --build-arg package="Tezos-rc" -t fedora-test -f docker/tests/Dockerfile-fedora-test .
docker build --build-arg dist="$version" --build-arg repo="Tezos-rc" -t fedora-test -f docker/tests/Dockerfile-fedora-test .
docker run fedora-test
done
4 changes: 2 additions & 2 deletions docker/tests/scripts/test-ubuntu-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
set -e

for version in $(jq -r '.ubuntu[]' docker/supported_versions.json); do
docker build --build-arg dist="$version" --build-arg package="tezos" -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test .
docker build --build-arg dist="$version" --build-arg repo="tezos" -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test .
docker run fedora-test
docker build --build-arg dist="$version" --build-arg package="tezos-rc" -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test .
docker build --build-arg dist="$version" --build-arg repo="tezos-rc" -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test .
docker run ubuntu-test
done
41 changes: 21 additions & 20 deletions docker/tests/test-fedora-binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,10 @@

import subprocess
import sys
import json
import os

binaries = [
"tezos-client",
"tezos-admin-client",
"tezos-node",
"tezos-signer",
"tezos-codec",
"tezos-baker-PtMumbai",
"tezos-accuser-PtMumbai",
"tezos-smart-rollup-client-PtMumbai",
"tezos-smart-rollup-node-PtMumbai",
"tezos-baker-PtNairob",
"tezos-accuser-PtNairob",
"tezos-smart-rollup-client-PtNairob",
"tezos-smart-rollup-node-PtNairob",
]


def test(cleanup: bool):
def test(binaries, cleanup):
subprocess.run("sudo dnf update -y", shell=True, capture_output=True)
processed_binaries = []
for binary in binaries:
Expand Down Expand Up @@ -52,6 +37,22 @@ def test(cleanup: bool):

if __name__ == "__main__":
cleanup = True
if len(sys.argv) > 1 and sys.argv[1] == "--no-cleanup":

f = open('/tezos-packaging/binaries.json')
data = json.load(f)

f.close()

binaries = []
is_released = os.environ['IS_RELEASED']
if is_released == 'Tezos':
binaries = data['released']
elif is_released == 'Tezos-rc':
binaries = data['candidates']
else:
raise "Incorrect argument"

if len(sys.argv) > 3 and sys.argv[2] == "--no-cleanup":
cleanup = False
test(cleanup)

test(binaries, cleanup)
41 changes: 21 additions & 20 deletions docker/tests/test-ubuntu-binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,10 @@

import subprocess
import sys
import json
import os

binaries = [
"tezos-client",
"tezos-admin-client",
"tezos-node",
"tezos-signer",
"tezos-codec",
"tezos-baker-PtMumbai",
"tezos-accuser-PtMumbai",
"tezos-smart-rollup-client-PtMumbai",
"tezos-smart-rollup-node-PtMumbai",
"tezos-baker-PtNairob",
"tezos-accuser-PtNairob",
"tezos-smart-rollup-client-PtNairob",
"tezos-smart-rollup-node-PtNairob",
]


def test(cleanup: bool):
def test(binaries, cleanup):
subprocess.run("apt update -y", shell=True, capture_output=True)
processed_binaries = []
for binary in binaries:
Expand Down Expand Up @@ -52,6 +37,22 @@ def test(cleanup: bool):

if __name__ == "__main__":
cleanup = True
if len(sys.argv) > 1 and sys.argv[1] == "--no-cleanup":

f = open('/tezos-packaging/binaries.json')
data = json.load(f)

f.close()

binaries = []
is_released = os.environ['IS_RELEASED']
if is_released == 'tezos':
binaries = data['released']
elif is_released == 'tezos-rc':
binaries = data['candidates']
else:
raise "Incorrect argument"

if len(sys.argv) > 3 and sys.argv[2] == "--no-cleanup":
cleanup = False
test(cleanup)

test(binaries, cleanup)

0 comments on commit ba41c2e

Please sign in to comment.