-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: We want to test that latests released binaries can be installed and work fine on different oses. Currently we support only Fedora and Ubuntu Solution: Add github actions that run docker dontainer with given os and install and execute each binary in it. Currently we run checks in parallel, 3 jobs per os.
- Loading branch information
1 parent
33a3423
commit 825aa3d
Showing
7 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test Tezos binaries | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
push: | ||
branches: | ||
- PruStephan/Add_tests_for_packages | ||
|
||
jobs: | ||
test_binaries: | ||
name: Install and test binaries | ||
runs-on: [self-hosted, Linux, X64, nix-with-docker] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test fedora binaries | ||
run: ./docker/tests/scripts/test-fedora-binaries.sh | ||
|
||
- name: Test ubuntu binaries | ||
run: ./docker/tests/scripts/test-fedora-binaries.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
ARG dist | ||
FROM fedora:${dist} | ||
|
||
WORKDIR /tezos-packaging/docker | ||
|
||
RUN dnf update -y | ||
RUN dnf install -y python3-devel python3-setuptools | ||
RUN sudo dnf update -y | ||
RUN sudo dnf install -y 'dnf-command(copr)' | ||
RUN sudo dnf copr enable -y @Serokell/Tezos | ||
|
||
COPY docker/tests/test-fedora-binaries.py /tezos-packaging/docker/tests/test-fedora-binaries.py | ||
CMD [ "python3", "/tezos-packaging/docker/tests/test-fedora-binaries.py", "--no-cleanup" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
ARG dist | ||
FROM ubuntu:${dist} | ||
|
||
WORKDIR /tezos-packaging/docker | ||
|
||
RUN apt update -y | ||
RUN apt-get install -y python3-all python3-setuptools | ||
RUN apt update -y | ||
RUN apt install -y software-properties-common | ||
RUN apt update -y | ||
RUN add-apt-repository -y ppa:serokell/tezos | ||
RUN apt-get update -y | ||
|
||
COPY docker/tests/test-ubuntu-binaries.py /tezos-packaging/docker/tests/test-ubuntu-binaries.py | ||
CMD [ "python3", "/tezos-packaging/docker/tests/test-ubuntu-binaries.py", "--no-cleanup" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
docker build --build-arg dist=latest -t fedora-test -f docker/tests/Dockerfile-fedora-test . | ||
docker run -i fedora-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
docker build --build-arg dist=latest -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test . | ||
docker run -i ubuntu-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
import subprocess | ||
import sys | ||
|
||
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): | ||
processed_binaries = [] | ||
for binary in binaries: | ||
try: | ||
install_command = f"sudo dnf install -y {binary}" | ||
installation_result = subprocess.run(install_command, shell=True) | ||
assert installation_result.returncode == 0 | ||
|
||
processed_binaries.append(binary) | ||
|
||
check_binary_command = f"sudo {binary} --version" | ||
check_binary_result = subprocess.run(check_binary_command, shell=True) | ||
assert check_binary_result.returncode == 0 | ||
except Exception as e: | ||
print(f"Exception happened when trying to execute tests for {binary}.\n") | ||
raise e | ||
if cleanup: | ||
for binary in processed_binaries: | ||
remove_res = subprocess.run(f"dnf remove {binary}") | ||
assert remove_res.returncode == 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
cleanup = True | ||
if len(sys.argv) > 1 and sys.argv[1] == "--no-cleanup": | ||
cleanup = False | ||
test(cleanup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
import subprocess | ||
import sys | ||
|
||
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): | ||
global binaries | ||
|
||
binaries = [s.lower() for s in binaries] | ||
|
||
processed_binaries = [] | ||
for binary in binaries: | ||
try: | ||
install_command = f"apt install -y {binary}" | ||
installation_result = subprocess.run(install_command, shell=True) | ||
assert installation_result.returncode == 0 | ||
|
||
processed_binaries.append(binary) | ||
|
||
check_binary_command = f"{binary} --version" | ||
check_binary_result = subprocess.run(check_binary_command, shell=True) | ||
assert check_binary_result.returncode == 0 | ||
except Exception as e: | ||
print(f"Exception happened when trying to execute tests for {binary}.\n") | ||
raise e | ||
if cleanup: | ||
for binary in processed_binaries: | ||
remove_res = subprocess.run("apt remove {binary}") | ||
assert remove_res.returncode == 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
cleanup = True | ||
if len(sys.argv) > 1 and sys.argv[1] == "--no-cleanup": | ||
cleanup = False | ||
test(cleanup) |