Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Create Release Build Test #7877

Merged
merged 29 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b7e678b
Create "release-build-test"
kj4ezj Sep 9, 2019
f904309
Add test name, purpose, and description
kj4ezj Sep 9, 2019
5e13ae3
Add descriptive pass/fail statements
kj4ezj Sep 9, 2019
38660c6
Print debug byte on failure
kj4ezj Sep 9, 2019
54ef8f6
Print first kB of shared_memory.bin on failure
kj4ezj Sep 9, 2019
e59ccac
Print useful error message if nodeos binary is not found
kj4ezj Sep 9, 2019
435c473
Clearer comments
kj4ezj Sep 10, 2019
c92f7ea
Print useful error if shared_memory.bin is not found
kj4ezj Sep 10, 2019
0014fc5
Use quotes in case paths have spaces
kj4ezj Sep 10, 2019
fd5f697
Better strings
kj4ezj Sep 10, 2019
810766a
Remove "set -e"
kj4ezj Sep 10, 2019
26192b4
Even clearer comments
kj4ezj Sep 10, 2019
c5cb128
Clean up after nodeos on test pass
kj4ezj Sep 10, 2019
a66af54
Clean up after nodeos on test fail
kj4ezj Sep 10, 2019
0fab022
Silence nodeos
kj4ezj Sep 10, 2019
afd078d
Add space after test result
kj4ezj Sep 10, 2019
eb8518d
Add release-build-test to non-parallelizable test group
kj4ezj Sep 10, 2019
fa32629
Fix line endings in Ubuntu dockerfiles
kj4ezj Sep 10, 2019
9d6bd48
Install vim-common on base images to get xxd for hex dumps
kj4ezj Sep 10, 2019
f57a38d
Print useful error message if hex dump tool is not found
kj4ezj Sep 10, 2019
d9c1cb0
Install jq on base-images for parsing nodeos output
kj4ezj Sep 10, 2019
630459d
Parse JSON build info instead of hexadecimal shared_memory.bin
kj4ezj Sep 10, 2019
e1ea4c1
Move release-build-test from non-parallelizable test group to paralle…
kj4ezj Sep 10, 2019
3ce6373
Install jq on Anka base-image, too
kj4ezj Sep 10, 2019
789e413
Print useful error message if jq is not found
kj4ezj Sep 10, 2019
64ebb34
Update test purpose, description, and outputs with swatanabe-b1's fee…
kj4ezj Sep 11, 2019
48b306a
Use relative paths instead of absolute paths with EOSIO_ROOT
kj4ezj Sep 12, 2019
be6dc1f
Better error message when nodeos is not found
kj4ezj Sep 12, 2019
bd6dff1
Don't forget to delete build-info.json when the test is done
kj4ezj Sep 12, 2019
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
2 changes: 1 addition & 1 deletion .cicd/platforms/amazon_linux-2-unpinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN yum update -y && \
yum install -y which git sudo procps-ng util-linux autoconf automake \
libtool make bzip2 bzip2-devel openssl-devel gmp-devel libstdc++ libcurl-devel \
libusbx-devel python3 python3-devel python-devel libedit-devel doxygen \
graphviz clang patch llvm-devel llvm-static
graphviz clang patch llvm-devel llvm-static vim-common jq
kj4ezj marked this conversation as resolved.
Show resolved Hide resolved
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
2 changes: 1 addition & 1 deletion .cicd/platforms/amazon_linux-2.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN yum update -y && \
yum install -y which git sudo procps-ng util-linux autoconf automake \
libtool make bzip2 bzip2-devel openssl-devel gmp-devel libstdc++ libcurl-devel \
libusbx-devel python3 python3-devel python-devel libedit-devel doxygen \
graphviz patch gcc gcc-c++
graphviz patch gcc gcc-c++ vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
3 changes: 2 additions & 1 deletion .cicd/platforms/centos-7.6-unpinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ FROM centos:7.6.1810
ENV VERSION 1
# install dependencies.
RUN yum update -y && \
yum install -y epel-release && \
yum --enablerepo=extras install -y centos-release-scl && \
yum --enablerepo=extras install -y devtoolset-8 && \
yum --enablerepo=extras install -y which git autoconf automake libtool make bzip2 doxygen \
graphviz bzip2-devel openssl-devel gmp-devel ocaml libicu-devel \
python python-devel rh-python36 gettext-devel file libusbx-devel \
libcurl-devel patch
libcurl-devel patch vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
source /opt/rh/devtoolset-8/enable && \
Expand Down
3 changes: 2 additions & 1 deletion .cicd/platforms/centos-7.6.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ FROM centos:7.6.1810
ENV VERSION 1
# install dependencies.
RUN yum update -y && \
yum install -y epel-release && \
yum --enablerepo=extras install -y centos-release-scl && \
yum --enablerepo=extras install -y devtoolset-8 && \
yum --enablerepo=extras install -y which git autoconf automake libtool make bzip2 doxygen \
graphviz bzip2-devel openssl-devel gmp-devel ocaml libicu-devel \
python python-devel rh-python36 gettext-devel file libusbx-devel \
libcurl-devel patch
libcurl-devel patch vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
source /opt/rh/devtoolset-8/enable && \
Expand Down
2 changes: 1 addition & 1 deletion .cicd/platforms/macos-10.14.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eo pipefail
VERSION=1
brew update
brew install git cmake python@2 python libtool libusb graphviz automake wget gmp llvm@7 pkgconfig doxygen openssl || true
brew install git cmake python@2 python libtool libusb graphviz automake wget gmp llvm@7 pkgconfig doxygen openssl jq || :
if [[ ! $PINNED == false || $UNPINNED == true ]]; then
# install clang from source
git clone --single-branch --branch release_80 https://git.llvm.org/git/llvm.git clang8
Expand Down
5 changes: 3 additions & 2 deletions .cicd/platforms/ubuntu-16.04.dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM ubuntu:16.04
ENV VERSION 1
# install dependencies.
RUN apt-get update && apt-get upgrade -y && \
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git automake \
libbz2-dev libssl-dev doxygen graphviz libgmp3-dev autotools-dev libicu-dev \
python2.7 python2.7-dev python3 python3-dev autoconf libtool curl zlib1g-dev \
sudo ruby libusb-1.0-0-dev libcurl4-gnutls-dev pkg-config apt-transport-https
sudo ruby libusb-1.0-0-dev libcurl4-gnutls-dev pkg-config apt-transport-https vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
5 changes: 3 additions & 2 deletions .cicd/platforms/ubuntu-18.04-unpinned.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM ubuntu:18.04
ENV VERSION 1
# install dependencies.
RUN apt-get update && apt-get upgrade -y && \
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git make \
bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \
autotools-dev libicu-dev python2.7 python2.7-dev python3 python3-dev \
autoconf libtool g++ gcc curl zlib1g-dev sudo ruby libusb-1.0-0-dev \
libcurl4-gnutls-dev pkg-config patch llvm-7-dev clang ccache
libcurl4-gnutls-dev pkg-config patch llvm-7-dev clang ccache vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
5 changes: 3 additions & 2 deletions .cicd/platforms/ubuntu-18.04.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM ubuntu:18.04
ENV VERSION 1
# install dependencies.
RUN apt-get update && apt-get upgrade -y && \
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git make \
bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \
autotools-dev libicu-dev python2.7 python2.7-dev python3 python3-dev \
autoconf libtool g++ gcc curl zlib1g-dev sudo ruby libusb-1.0-0-dev \
libcurl4-gnutls-dev pkg-config patch ccache
libcurl4-gnutls-dev pkg-config patch ccache vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/validate-dirty-db.py ${CMAKE_CURRENT_
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/launcher_test.py ${CMAKE_CURRENT_BINARY_DIR}/launcher_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/db_modes_test.sh ${CMAKE_CURRENT_BINARY_DIR}/db_modes_test.sh COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/prod_preactivation_test.py ${CMAKE_CURRENT_BINARY_DIR}/prod_preactivation_test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/release-build.sh ${CMAKE_CURRENT_BINARY_DIR}/release-build.sh COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version-label.sh ${CMAKE_CURRENT_BINARY_DIR}/version-label.sh COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nodeos_producer_watermark_test.py ${CMAKE_CURRENT_BINARY_DIR}/nodeos_producer_watermark_test.py COPYONLY)

Expand Down Expand Up @@ -87,6 +88,7 @@ add_test(NAME launcher_test COMMAND tests/launcher_test.py -v --clean-run --dump
set_property(TEST launcher_test PROPERTY LABELS nonparallelizable_tests)
add_test(NAME db_modes_test COMMAND tests/db_modes_test.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(db_modes_test PROPERTIES COST 6000)
add_test(NAME release-build-test COMMAND tests/release-build.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME version-label-test COMMAND tests/version-label.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

# Long running tests
Expand Down
58 changes: 58 additions & 0 deletions tests/release-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# test name and purpose
echo ''
echo ' ##### Release Build Test #####'
echo ''
echo ' The purpose of this test is to ensure that nodeos was built with compiler'
kj4ezj marked this conversation as resolved.
Show resolved Hide resolved
echo 'optimizations enabled. While there is no way to programmatically determine that'
echo 'given one binary, we do set a debug flag in nodeos when it is built with'
echo 'asserts. This test checks that debug flag. Anyone intending to build and install'
echo 'nodeos from source should perform a "release build" which excludes asserts and'
echo 'debugging symbols, and performs compiler optimizations.'
echo ''
# check for jq
if ! $(jq --version 1>/dev/null); then
echo 'ERROR: Test requires jq, but jq was not found in your PATH!'
echo ''
exit 1
fi
# find nodeos
[[ $(git --version) ]] && cd "$(git rev-parse --show-toplevel)/build/programs/nodeos" || cd "$(dirname "${BASH_SOURCE[0]}")/../programs/nodeos"
if [[ ! -f nodeos ]]; then
echo 'ERROR: nodeos binary not found!'
echo ''
echo 'I looked here...'
echo "$ ls -la \"$(pwd)/programs/nodeos\""
ls -la "$(pwd)/programs/nodeos"
echo '...which I derived from one of these paths:'
echo '$ echo "$(git rev-parse --show-toplevel)/build"'
echo "$(git rev-parse --show-toplevel)/build"
echo '$ echo "$(dirname "${BASH_SOURCE[0]}")/.."'
echo "$(dirname "${BASH_SOURCE[0]}")/.."
echo 'Release build test not run.'
exit 1
fi
# run nodeos to generate state files
./nodeos --extract-build-info build-info.json 1>/dev/null 2>/dev/null
if [[ ! -f build-info.json ]]; then
echo 'ERROR: Build info JSON file not found!'
echo ''
echo 'Looked in the following places:'
echo "$ ls -la \"$(pwd)\""
ls -la "$(pwd)"
echo 'Release build test not run.'
exit 2
fi
# test state files for debug flag
if [[ "$(cat build-info.json | jq .debug)" == 'false' ]]; then
kj4ezj marked this conversation as resolved.
Show resolved Hide resolved
echo 'PASS: Debug flag is not set.'
echo ''
rm build-info.json
exit 0
fi
echo 'FAIL: Debug flag is set!'
echo ''
echo '$ cat build-info.json | jq .'
cat build-info.json | jq .
rm build-info.json
exit 3