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

[1.8.x] BATS bash tests for build scripts + various other improvements and fixes #7458

Merged
merged 22 commits into from
Jun 10, 2019

Conversation

NorseGaud
Copy link
Contributor

@NorseGaud NorseGaud commented Jun 3, 2019

Change Description

  • BATS-CORE is being used for bash unit testing: This will allow us to ensure bash scripts function as they should for users. It's perfect for regression testing and consistency. (see tests/bash-bats/README.md)
  • CICD Pipeline/steps run as the user cicd (instead of root)
    • Improvements to log output in buildkite showing a collapsed tab for each and every command the scripts run.
    • Auto retry failed step on -1 (Agent Lost)
  • Users are prompted if 'which' is missing (we will install it for them if they want): linux build scripts "which/c++: command not found" #7232
  • All prompts are now properly wrapped to be user friendly: scripts/eosio_build.sh is unfriendly when asking "Do you wish to update repositories"? #6931
  • New eosio path: ~/eosio/$VersionFromCmakeFile/ to store dependencies and eosio: scripts/eosio_build.sh is unfriendly when asking "Do you wish to update repositories"? #6931
  • Script filename extensions are now .bash, indicating that bash is required to properly execute.
  • Scripts now use #!/usr/bin/env to pull bash if it's installed into nonstandard /bin/ location
  • Better uninstaller script, removing old "full_uninstaller" (readme updated)
  • Build scripts support DRYRUN=true (doesn't execute anything, but shows you what it would do) and VERBOSE=true (shows the exact commands executed throughout script) for better troubleshooting.
  • Scripts use set -ieo pipefail so they fail properly when a command fails and also show colors for users executing the script (colors not supported on mac yet).
  • Using *_deps file for each distro
    • Package dependency files include flexibility by allowing us to specify what command is used to check if it exists or not (dpkg -s/rpm -qa)
    • no more extra space at end of deps file! (yay)
  • Using helpers/functions for modularity, avoiding having to repeat ourselves in each eosio_build_* script
  • Environment variables have been moved into a separate file for better flexibility
    • Test scripts can pull in the same variables
    • comments added for better comprehension

Compiler support

_You can see almost all of these tests passing in https://buildkite.com/EOSIO/eosio-base-images/builds/170

OS -P existing compiler existing c++/clang < required version no existing compiler
Darwin ✅ Will prompt for pin/install clang8 ✔️ (Hasn't been tested)
Centos 7 ✅ devtoolset-7 ✔️ (Hasn't been tested) ✅ Will prompt for install of build-essentials (fails: see below)
AmazonLinux 2 ✅ gcc-c++ ✔️ (Hasn't been tested) ✅ exits and notifies user
Ubuntu 16.04 ✔️ (Hasn't been tested) ✅ Will prompt for pin/install clang8 ✅ exits and notifies user
Ubuntu 18.04 ✔️ (Hasn't been tested) ✅ Will prompt for pin/install clang8 ✅ Will prompt for install of build-essentials

List of issues

  1. scripts/eosio_build.sh is unfriendly when asking "Do you wish to update repositories"? #6931 : Prompts are now humane + install into version specific folder
  2. centos build script has no sudo; implicitly encourages build as root #7120 : Centos 7 will now use sudo for yum commands if $(whoami) = root
  3. build script boost detection inconsistent and causes grief via not finding boost #7262 : New directory structure should fix this
  4. build script on clean install has compiler detection error #7260 : New logic should prevent this from being a problem
  5. linux build scripts "which/c++: command not found" #7232 : User prompts if missing which or c++ (and not using -P).

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Nathan Pierce added 3 commits June 3, 2019 18:24
…c for test pipeline + CMakeLists.txt change to support versioned location
@NorseGaud NorseGaud changed the base branch from master to release/1.8.x June 3, 2019 22:42
scripts/.environment Outdated Show resolved Hide resolved
scripts/.environment Outdated Show resolved Hide resolved
scripts/.environment Outdated Show resolved Hide resolved
scripts/.environment Outdated Show resolved Hide resolved
scripts/.environment Outdated Show resolved Hide resolved
scripts/helpers/eosio.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
scripts/helpers/eosio.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Show resolved Hide resolved
scripts/helpers/eosio.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
scripts/eosio_build.sh Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@NorseGaud NorseGaud merged commit 29e3698 into release/1.8.x Jun 10, 2019
@NorseGaud NorseGaud deleted the 1.8.x-bash-scripts branch June 10, 2019 21:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants