Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: bitcoin#12134, #18426, #18534, #18828, #18864, #19153, #19201, #19205, #19560, #19813, #19859, partial #20354, #20955, #22442, #22790 #5537

Merged
merged 23 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
207b1c5
Merge #12134: Build previous releases and run functional tests
Feb 12, 2020
080a038
Merge #18426: scripts: previous_release: improve behaviour on failed …
fanquake Apr 3, 2020
04cc0ac
Merge #18534: test: skip backwards compat tests if not compiled with …
Apr 6, 2020
a5cb668
Merge #18828: test: Strip down previous releases boilerplate
May 1, 2020
35f57b9
Merge #19201: ci: Switch to bitcoincore.org download
Jun 7, 2020
f68d127
Merge #19153: test: mempool compatibility test
Jun 16, 2020
7ddcf4a
Merge #18864: Add v0.16.3 backwards compatibility test, bump v0.19.0.…
knst Aug 11, 2023
7c43fa5
Merge #19205: script: previous_release.sh rewritten in python
Jul 21, 2020
915c1f2
Merge #19560: contrib: Clean up previous_releases.py
fanquake Jul 21, 2020
da35562
Merge #19813: util, ci: Hard code previous release tarball checksums
Aug 31, 2020
b68936f
Merge #19859: qa: Fixes failing functional test by changing version
laanwj Sep 3, 2020
9cbe0de
Merge #20955: test: Fix get_previous_releases.py for aarch64
laanwj Jan 18, 2021
67481ee
Merge bitcoin/bitcoin#22442: util: improves error messages on get_pre…
Jul 25, 2021
a368488
partial Merge bitcoin/bitcoin#20354: test: Add feature_taproot.py --p…
Jul 14, 2021
8a9712e
fix: dashification of test/get_previous_releases.py
knst Jun 12, 2023
f093c94
fix: dashification of of hashsums in get_previous_releases.py
knst Aug 10, 2023
08a37a3
fix: missing changes from bitcoin#20034 test: Get rid of default wall…
knst Jun 12, 2023
fe1e8c2
fix: missing changes from Merge #18067: wallet: Improve LegacyScriptP…
Sjors Feb 11, 2020
fab1031
fix: missing changes from Merge #18873: Fix intermittent sync_blocks …
knst Aug 11, 2023
eb63479
fix: missing changes from Merge #18253: doc: Correct spelling errors …
Empact Mar 3, 2020
f878b28
fix: fillow-up Merge #18774: test: added test for upgradewallet RPC
knst Aug 14, 2023
90285f5
Merge bitcoin/bitcoin#22790: test: add aarch64-apple-darwin platform …
Sep 22, 2021
affcaca
feat: cache downloaded releases
UdjinM6 Aug 23, 2023
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ qrc_*.cpp
build
*.dSYM

# Previous releases
releases

#lcov
*.gcno
*.gcda
Expand Down
9 changes: 9 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ builder-image:
script:
- echo "INTEGRATION_TESTS_ARGS=${INTEGRATION_TESTS_ARGS}"
- ./ci/dash/test_integrationtests.sh $INTEGRATION_TESTS_ARGS
cache:
# Let all branches share the same cache, which is ok because get_previous_releases.py extracts release binaries in separate folders
key:
files:
# CI files where $PREVIOUS_RELEASES_TO_DOWNLOAD is defined
- ci/test/00_setup_env_native_qt5.sh
prefix: ${CI_JOB_NAME}
paths:
- releases
after_script:
- mkdir -p $CI_PROJECT_DIR/testlogs
artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
cache:
ccache: true
directories:
- $BASE_BUILD_DIR/ci/scratch/.ccache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this dropping cache?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't use Travis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that is true :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use Travis, I'm just keeping this changes for backport compatibility. It doesn't affect any caches bcs no travis at all. But if there's any good idea, we can adapt it for our CI.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo it's fine to just backport changes for Travis as is and implement similar dashified ones for Gitlab

what is missing in our backport is release cache they added when they changed this line, we could add one too - pls see (and test) 7fe8c49

this PR:
first run https://gitlab.com/dashpay/dash/-/jobs/4911762972#L106 (downloading)
second run https://gitlab.com/dashpay/dash/-/jobs/4934280594#L106 (downloading)

7fe8c49:
first run https://gitlab.com/UdjinM6/dash/-/jobs/4935068647#L59 (downloading)
another branch with a dummy commit on top https://gitlab.com/UdjinM6/dash/-/jobs/4935596048#L62 (using cache)

- $BASE_BUILD_DIR/releases/$HOST
before_cache:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
env:
Expand Down Expand Up @@ -244,7 +244,7 @@ after_success:
FILE_ENV="./ci/test/00_setup_env_win64.sh"

- stage: test
name: 'x86_64 Linux [GOAL: install] [focal] [uses qt5 dev package and some depends packages] [unsigned char]'
name: 'x86_64 Linux [GOAL: install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]'
env: >-
FILE_ENV="./ci/test/00_setup_env_native_qt5.sh"
# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSan))
Expand Down
2 changes: 1 addition & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If the repository is not a fresh git clone, you might have to clean files from p

The ci needs to perform various sysadmin tasks such as installing packages or writing to the user's home directory.
While most of the actions are done inside a docker container, this is not possible for all. Thus, cache directories,
such as the depends cache or ccache, are mounted as read-write into the docker container. While it should be fine to run
such as the depends cache, previous release binaries, or ccache, are mounted as read-write into the docker container. While it should be fine to run
the ci system locally on you development box, the ci scripts can generally be assumed to have received less review and
testing compared to other parts of the codebase. If you want to keep the work tree clean, you might want to run the ci
system in a virtual machine with a Linux operating system of your choice.
Expand Down
5 changes: 5 additions & 0 deletions ci/dash/test_integrationtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ fi

export LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib

if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then
echo "Downloading previous releases: $PREVIOUS_RELEASES_TO_DOWNLOAD"
./test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" ${PREVIOUS_RELEASES_TO_DOWNLOAD}
fi

cd build-ci/dashcore-$BUILD_TARGET

if [ "$SOCKETEVENTS" = "" ]; then
Expand Down
2 changes: 2 additions & 0 deletions ci/test/00_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
export RUN_INTEGRATION_TESTS=${RUN_INTEGRATION_TESTS:-true}
export RUN_SECURITY_TESTS=${RUN_SECURITY_TESTS:-false}
export TEST_PREVIOUS_RELEASES=${TEST_PREVIOUS_RELEASES:-false}
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
export RUN_SYMBOL_TESTS=${RUN_SYMBOL_TESTS:-true}
export CONTAINER_NAME=${CONTAINER_NAME:-ci_unnamed}
Expand All @@ -59,6 +60,7 @@ export CCACHE_DIR=${CCACHE_DIR:-$CACHE_DIR/ccache}
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
# Folder where the build is done (bin and lib).
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST}
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
export DOCKER_PACKAGES=${DOCKER_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps}
export GOAL=${GOAL:-install}
Expand Down
2 changes: 2 additions & 0 deletions ci/test/00_setup_env_native_qt5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export DEP_OPTS="NO_UPNP=1 DEBUG=1"
export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false"
export GOAL="install"
export TEST_PREVIOUS_RELEASES=true
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.0.0 v0.16.1.1 v0.17.0.3 v18.2.2 v19.3.0"
export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --disable-fuzz-binary LDFLAGS=-static-libstdc++"
4 changes: 3 additions & 1 deletion ci/test/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ fi

mkdir -p "${BASE_SCRATCH_DIR}"
mkdir -p "${CCACHE_DIR}"
mkdir -p "${PREVIOUS_RELEASES_DIR}"

export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1"
export LSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/lsan"
export TSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/tsan"
export UBSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
env | grep -E '^(BASE_|QEMU_|CCACHE_|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
env | grep -E '^(BASE_|QEMU_|CCACHE_|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS|TEST_PREVIOUS_RELEASES|PREVIOUS_RELEASES_DIR))' | tee /tmp/env
if [[ $HOST = *-mingw32 ]]; then
DOCKER_ADMIN="--cap-add SYS_ADMIN"
elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
Expand All @@ -42,6 +43,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
--mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \
--mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \
--mount type=bind,src=$DEPENDS_DIR,dst=$DEPENDS_DIR \
--mount type=bind,src=$PREVIOUS_RELEASES_DIR,dst=$PREVIOUS_RELEASES_DIR \
-w $BASE_ROOT_DIR \
--env-file /tmp/env \
--name $CONTAINER_NAME \
Expand Down
7 changes: 6 additions & 1 deletion ci/test/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ $HOST = *-mingw32 ]]; then
fi
if [ -z "$NO_DEPENDS" ]; then
if [[ $DOCKER_NAME_TAG == centos* ]]; then
# CentOS has problems building the depends if the config shell is not explicitely set
# CentOS has problems building the depends if the config shell is not explicitly set
# (i.e. for libevent a Makefile with an empty SHELL variable is generated, leading to
# an error as the first command is executed)
SHELL_OPTS="CONFIG_SHELL=/bin/bash"
Expand All @@ -35,3 +35,8 @@ if [ -z "$NO_DEPENDS" ]; then
fi
DOCKER_EXEC $SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
fi
if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then
BEGIN_FOLD previous-versions
DOCKER_EXEC test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" "${PREVIOUS_RELEASES_TO_DOWNLOAD}"
END_FOLD
fi
6 changes: 6 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ Run all possible tests with
test/functional/test_runner.py --extended
```

In order to run backwards compatibility tests, download the previous node binaries:

```
test/get_previous_releases.py -b v19.3.0 v18.2.2 v0.17.0.3 v0.16.1.1 v0.15.0.0
```

By default, up to 4 tests will be run in parallel by test_runner. To specify
how many jobs to run, append `--jobs=n`

Expand Down
Loading
Loading