test: Rework ci (Use travis only as fallback env) #16582

pull MarcoFalke wants to merge 5 commits into bitcoin:master from MarcoFalke:1908-ciRework changing 19 files +452 −82
  1. MarcoFalke commented at 4:15 pm on August 10, 2019: member
    This moves the .travis folder to ci and removes dependence on travis, so that the test script can be run anywhere.
  2. DrahtBot added the label Docs on Aug 10, 2019
  3. DrahtBot added the label Tests on Aug 10, 2019
  4. practicalswift commented at 6:04 pm on August 10, 2019: contributor
    @MarcoFalke Could you provide some additional context? With this PR merged tests would still run in both Appveyor and Travis, right? What is the plan? :-)
  5. MarcoFalke commented at 1:32 am on August 11, 2019: member
    The plan is to be flexible, to be able to switch away from travis any time without much hassle. Also, this makes it easier to run the ci locally.
  6. in ci/README.md:5 in 9444777374 outdated
    0@@ -0,0 +1,8 @@
    1+## ci scripts
    2+
    3+This directory contains scripts for each build step in each build stage.
    4+
    5+Currently three stages `lint`, `extended_lint` and `test` are defined. Each stage has it's own lifecycle, similar to the
    


    sipa commented at 2:25 am on August 11, 2019:
    its
  7. MarcoFalke force-pushed on Aug 11, 2019
  8. MarcoFalke force-pushed on Aug 11, 2019
  9. promag commented at 1:48 pm on August 11, 2019: member
    Concept ACK.
  10. MarcoFalke force-pushed on Aug 11, 2019
  11. MarcoFalke force-pushed on Aug 11, 2019
  12. MarcoFalke force-pushed on Aug 11, 2019
  13. MarcoFalke force-pushed on Aug 11, 2019
  14. MarcoFalke force-pushed on Aug 11, 2019
  15. MarcoFalke removed the label Docs on Aug 11, 2019
  16. MarcoFalke force-pushed on Aug 11, 2019
  17. MarcoFalke force-pushed on Aug 11, 2019
  18. MarcoFalke force-pushed on Aug 11, 2019
  19. MarcoFalke force-pushed on Aug 11, 2019
  20. MarcoFalke force-pushed on Aug 11, 2019
  21. MarcoFalke force-pushed on Aug 11, 2019
  22. MarcoFalke force-pushed on Aug 11, 2019
  23. MarcoFalke force-pushed on Aug 11, 2019
  24. MarcoFalke commented at 3:17 pm on August 11, 2019: member
    Fixed typo in doc and added a note on how to run the ci locally
  25. MarcoFalke force-pushed on Aug 11, 2019
  26. MarcoFalke force-pushed on Aug 11, 2019
  27. MarcoFalke force-pushed on Aug 11, 2019
  28. MarcoFalke force-pushed on Aug 11, 2019
  29. MarcoFalke force-pushed on Aug 11, 2019
  30. MarcoFalke force-pushed on Aug 11, 2019
  31. MarcoFalke force-pushed on Aug 11, 2019
  32. DrahtBot commented at 4:44 pm on August 11, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16597 ([WIP] Travis: run full test suite on native macOS by Sjors)
    • #12134 (Build previous releases and run functional tests by Sjors)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  33. MarcoFalke force-pushed on Aug 11, 2019
  34. MarcoFalke force-pushed on Aug 11, 2019
  35. MarcoFalke force-pushed on Aug 11, 2019
  36. MarcoFalke force-pushed on Aug 11, 2019
  37. MarcoFalke force-pushed on Aug 11, 2019
  38. MarcoFalke force-pushed on Aug 11, 2019
  39. MarcoFalke force-pushed on Aug 11, 2019
  40. MarcoFalke force-pushed on Aug 11, 2019
  41. MarcoFalke force-pushed on Aug 11, 2019
  42. MarcoFalke force-pushed on Aug 11, 2019
  43. MarcoFalke force-pushed on Aug 11, 2019
  44. MarcoFalke force-pushed on Aug 11, 2019
  45. MarcoFalke force-pushed on Aug 11, 2019
  46. MarcoFalke force-pushed on Aug 11, 2019
  47. MarcoFalke force-pushed on Aug 11, 2019
  48. MarcoFalke force-pushed on Aug 11, 2019
  49. MarcoFalke force-pushed on Aug 11, 2019
  50. MarcoFalke force-pushed on Aug 11, 2019
  51. in ci/README.md:15 in fa6382cc4d outdated
    10+
    11+To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage
    12+requires `docker` to be installed. To install all requirements on Ubuntu, run
    13+
    14+```
    15+sudo apt install docker.io ccache bash git
    


    fanquake commented at 0:53 am on August 12, 2019:
    I’d rather we just have a note to look at the official docs for how to install docker-ce. docker.io is an “old” version and the docs recommend uninstalling it.

    MarcoFalke commented at 11:50 am on August 12, 2019:
    Huh? According to https://packages.ubuntu.com/xenial/docker.io it is the latest version. We don’t need any fancy new features (other than --mount), so it should be fine as is.

    fanquake commented at 11:58 am on August 12, 2019:

    Interesting. From the Docker documentation:

    Older versions of Docker were called docker, docker.io , or docker-engine. If these are installed, uninstall them:

    0sudo apt-get remove docker docker-engine docker.io containerd runc
    

    I guess I don’t mind either way, just wasn’t sure after looking at those docs.

  52. in ci/README.md:6 in fa6382cc4d outdated
    0@@ -0,0 +1,24 @@
    1+## ci scripts
    2+
    3+This directory contains scripts for each build step in each build stage.
    4+
    5+Currently three stages `lint`, `extended_lint` and `test` are defined. Each stage has its own lifecycle, similar to the
    6+[Travis CI lifecycle](https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle).  Every script in here is named
    


    fanquake commented at 0:55 am on August 12, 2019:
    nit: extra space
  53. in ci/test/04_install.sh:9 in fa6382cc4d outdated
    0@@ -0,0 +1,49 @@
    1+#!/usr/bin/env bash
    2+#
    3+# Copyright (c) 2018 The Bitcoin Core developers
    4+# Distributed under the MIT software license, see the accompanying
    5+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
    6+
    7+export LC_ALL=C.UTF-8
    8+
    9+ccache echo "Create ccache dir, if it didn't exist"
    


    fanquake commented at 1:18 am on August 12, 2019:
    0ccache echo "Creating ccache dir if it didn't already exist"
    
  54. fanquake commented at 2:53 am on August 12, 2019: member

    Concept ACK.

    Have tested running the CI locally on macOS using Docker and ./ci/test_run_all.sh. Everything seems to work as expected.

    It’s a little annoying that we have to bring more bash scripts into this repo, but I guess they can just sit, and we wont have to modify/touch them at all.

    edit: Could also add out/ and qa-assets/ to .gitignore.

  55. MarcoFalke force-pushed on Aug 12, 2019
  56. MarcoFalke commented at 12:06 pm on August 12, 2019: member

    Have tested running the CI locally on macOS using Docker and ./ci/test_run_all.sh. Everything seems to work as expected.

    Thanks for testing on mac!

    So this is confirmed to be working on:

  57. instagibbs commented at 1:08 pm on August 12, 2019: member

    Also, this makes it easier to run the ci locally.

    Concept ACK!

  58. in ci/retry/retry:20 in faafa4739a outdated
    15+
    16+__log_out() {
    17+  echo "$1" 1>&2
    18+}
    19+
    20+# Paramters: max_tries min_sleep max_sleep constant_sleep fail_script EXECUTION_COMMAND
    


    practicalswift commented at 7:37 am on August 14, 2019:
    Should be “parameters” :-)

    fanquake commented at 7:47 am on August 14, 2019:
    This is an upstream script, so we don’t need to fix it’s issues here. Regardless, I’ve PR’d them upstream.
  59. in ci/retry/retry:86 in faafa4739a outdated
    81+Usage: $retry [options] -- execute command
    82+    -h, -?, --help
    83+    -v, --verbose                    Verbose output
    84+    -t, --tries=#                    Set max retries: Default 10
    85+    -s, --sleep=secs                 Constant sleep amount (seconds)
    86+    -m, --min=secs                   Exponenetial Backoff: minimum sleep amount (seconds): Default 0.3
    


    practicalswift commented at 7:38 am on August 14, 2019:
    Should be exponential – applies throughout PR :-)
  60. in .cirrus.yml:30 in faafa4739a outdated
    26@@ -27,3 +27,26 @@ task:
    27     - gmake check ${MAKEJOBS} VERBOSE=1
    28   functional_test_script:
    29     - ./test/functional/test_runner.py --jobs 9 --ci --extended --exclude feature_dbcrash --combinedlogslen=1000 --quiet --failfast
    30+task:
    


    practicalswift commented at 7:39 am on August 14, 2019:
    Duplication of key task in mapping?

    MarcoFalke commented at 2:09 pm on August 14, 2019:
  61. in .cirrus.yml:47 in faafa4739a outdated
    41+    CCACHE_DIR: "/tmp/ccache_dir"
    42+  ccache_cache:
    43+    folder: "/tmp/ccache_dir"
    44+  depends_cache:
    45+    folder: "/tmp/cirrus-ci-build/depends/built"
    46+    folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
    


    practicalswift commented at 7:39 am on August 14, 2019:
    Duplication of key folder in mapping?
  62. DrahtBot added the label Needs rebase on Aug 14, 2019
  63. MarcoFalke force-pushed on Aug 14, 2019
  64. MarcoFalke commented at 5:40 pm on August 14, 2019: member
    Rebased with three-way-merge due to change in tangent line
  65. DrahtBot removed the label Needs rebase on Aug 14, 2019
  66. fanquake commented at 12:39 pm on August 15, 2019: member

    I’m now seeing an error running this:

     0configure.ac:40: installing 'build-aux/missing'
     1src/Makefile.am: installing 'build-aux/depcomp'
     2travis_fold:end:autogen
     3
     4travis_fold:start:configure
     5configure: loading site script /Users/michael/github/bitcoin/depends/x86_64-unknown-linux-gnu/share/config.site
     6configure: loading cache config.cache
     7checking build system type... x86_64-pc-linux-gnu
     8checking host system type... x86_64-unknown-linux-gnu
     9checking for a BSD-compatible install... /usr/bin/install -c
    10checking whether build environment is sane... yes
    11checking for x86_64-unknown-linux-gnu-strip... no
    12checking for strip... strip
    13checking for a thread-safe mkdir -p... /bin/mkdir -p
    14checking for gawk... no
    15checking for mawk... mawk
    16checking whether make sets $(MAKE)... yes
    17checking whether make supports nested variables... yes
    18configure: error: source directory already configured; run "make distclean" there first
    19This file contains any messages produced by compilers while
    20running configure, to aid debugging if configure makes a mistake.
    21
    22It was created by Bitcoin Core configure 0.18.99, which was
    23generated by GNU Autoconf 2.69.  Invocation command line was
    24
    25  $ ../configure --cache-file=config.cache --disable-dependency-tracking --prefix=/Users/michael/github/bitcoin/depends/x86_64-unknown-linux-gnu --bindir=/Users/michael/github/bitcoin/out/x86_64-unknown-linux-gnu/bin --libdir=/Users/michael/github/bitcoin/out/x86_64-unknown-linux-gnu/lib
    
  67. MarcoFalke commented at 12:45 pm on August 15, 2019: member
    It says source directory already configured; run "make distclean" there first. Have you tried that?
  68. MarcoFalke commented at 12:48 pm on August 15, 2019: member

    Specifically cd /Users/michael/github/bitcoin && make distclean.

    The ci is generally assuming the the folder is a fresh git clone. If needed, that can be changed later on, but better not part of this pull.

  69. fanquake commented at 12:49 pm on August 15, 2019: member

    It says source directory already configured; run “make distclean” there first. Have you tried that?

    Shouldn’t that all be handled by the script? If not, then some docs about why you can’t run the tests twice in a row would be handy.

  70. MarcoFalke commented at 12:59 pm on August 15, 2019: member
    Done
  71. MarcoFalke force-pushed on Aug 15, 2019
  72. fanquake approved
  73. fanquake commented at 1:21 pm on August 15, 2019: member
    Thanks ACK fa9404d76d16c618dbd2c19973246900918f9e6c - Maybe @sipsorcery or @NicolasDorier might also want to test here, then we’d have all OS’s covered?
  74. MarcoFalke commented at 1:53 pm on August 15, 2019: member
    I don’t think docker on windows can run Ubuntu containers
  75. DrahtBot commented at 3:06 pm on August 15, 2019: member
  76. DrahtBot added the label Needs rebase on Aug 15, 2019
  77. ci: Rename .travis/ to ./ci/ fafe78f6ae
  78. ci: Add retry
    From: https://github.com/kadwanev/retry/tree/a1b1826bdb0a78189d5c70c858dc676f5133b1d7
    fa0aac0f43
  79. ci: Remove dependence on travis, use it as fallback env fa31bc35eb
  80. ci: Use ./ci/ on non-travis host fa6cbdc3c9
  81. ci: Add note that this assumes a fresh git clone faeacf3269
  82. MarcoFalke force-pushed on Aug 15, 2019
  83. MarcoFalke commented at 3:15 pm on August 15, 2019: member
    Rebased without any changes due to overly sensitive merge conflict detection on GitHub. git range-diff should be empty: git range-diff bitcoin/master fa9404d76d faeacf3269
  84. MarcoFalke merged this on Aug 15, 2019
  85. MarcoFalke closed this on Aug 15, 2019

  86. MarcoFalke deleted the branch on Aug 15, 2019
  87. MarcoFalke referenced this in commit 367b023ae4 on Aug 15, 2019
  88. sipsorcery commented at 7:16 pm on August 15, 2019: member

    I don’t think docker on windows can run Ubuntu containers

    It can since https://docs.docker.com/docker-for-windows/wsl-tech-preview/

    0aaron@pcdodo:~$ uname -a
    1Linux pcdodo 4.19.57-microsoft-standard [#1](/bitcoin-bitcoin/1/) SMP Wed Jul 3 20:47:25 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    2aaron@pcdodo:~$ docker run ubuntu echo "I  love Windows"; lsb_release -a
    3I  love Windows
    4No LSB modules are available.
    5Distributor ID: Ubuntu
    6Description:    Ubuntu 18.04.2 LTS
    7Release:        18.04
    8Codename:       bionic
    

    Actually it was already possible to use ubuntu docker containers on Windows but now it possible directly on top of the Windows Subsystem for Linux kernel.

  89. sipsorcery commented at 7:21 pm on August 15, 2019: member

    Thanks ACK fa9404d - Maybe @sipsorcery or @NicolasDorier might also want to test here, then we’d have all OS’s covered? @fanquake I looked over the PR and successfully ran my appveyor build with the PR merged. Doesn’t seem to be anything Windows related in this PR? Ony travis and shell scripts. Or did you testing the script changes with the WSL/Mingw builds on Windows?

  90. fanquake commented at 1:02 am on August 16, 2019: member

    Thanks @sipsorcery. I also thought it was possible to run on Windows.

    Or did you testing the script changes with the WSL/Mingw builds on Windows?

    Yea I just meant checking out this PR, and testing/running the scripts, to make sure they were working in your Windows development setups.

  91. laanwj removed the label Needs rebase on Oct 24, 2019
  92. vijaydasmp referenced this in commit bbae812c5d on Oct 2, 2021
  93. kittywhiskers referenced this in commit 68cd29c0ab on Dec 13, 2021
  94. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me