Page MenuHomePhabricator

Merge #16931: test: add unittests for CheckProofOfWork
ClosedPublic

Authored by jasonbcox on Oct 19 2020, 23:57.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCa87c1a8f2312: Merge #16931: test: add unittests for CheckProofOfWork
Summary

0cc7dd74e0af735dddf7e786f4ed136c382a4ad5 test: add unittests for CheckProofOfWork (soroosh-sdi)

Pull request description:

following situations are covered:
- negative target
- overflow target
- target easier then powLimit
- invalid hash (hash > target)

Backport of Core PR16931

Test Plan

ninja check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Tail of the build log:

  -t abc-base-image-"${HASH}" debian:buster

(cat <<EOF
results() {
  set +e
  shopt -s dotglob nullglob
  mv /work/abc-ci-builds/"build-debug"/* /results
  chown -R ${ME} /work
  chown -R ${ME} /results
  chown -R ${ME} /root/.ccache
}
trap "results" EXIT
export TEAMCITY_VERSION="2019.2.4 (build 72059)"
export BASE_CACHE="/root/abc-depends/cache"
export SDK_ARCHIVE_DIR="/root/abc-depends/osx-sdk"
export SOURCES_PATH="/root/abc-depends/sources"
mkdir -p "/root/abc-depends/cache" "/root/abc-depends/osx-sdk" "/root/abc-depends/sources"
./contrib/teamcity/build-configurations.py "build-debug"
EOF
) > run-command.sh
chmod +x run-command.sh

~/infra/docker/docker-run.sh \
  -a "-v /home/teamcity/.ccache:/root/.ccache -v /home/teamcity/.abc-depends:/root/abc-depends -v "${RESULTS_DIR}":/results" \
  -c run-command.sh /work/run-command.sh abc-base-image-"${HASH}" ./run-command.sh

[23:58:25] :	 [Step 1/1] Starting: /home/teamcity/buildAgent/temp/agentTmp/custom_script3243622267445795816
[23:58:25] :	 [Step 1/1] in directory: /home/teamcity/buildAgent/work/jailed-build
[23:58:25] :	 [Step 1/1] ~/buildAgent/work/jailed-build/bitcoin-abc ~/buildAgent/work/jailed-build
[23:58:25] :	 [Step 1/1] ~/buildAgent/work/jailed-build
[23:58:25] :	 [Step 1/1] Building base image for: e46a2cee8...
[23:58:25] :	 [Step 1/1] ~/buildAgent/work/jailed-build/bitcoin-abc ~/buildAgent/work/jailed-build
[23:58:27] :	 [Step 1/1] ~/buildAgent/work/jailed-build
[23:58:27] :	 [Step 1/1] Tag name: abc-base-image-e46a2cee8
[23:58:37]W:	 [Step 1/1] Traceback (most recent call last):
[23:58:37]W:	 [Step 1/1]   File "./contrib/teamcity/build-configurations.py", line 570, in <module>
[23:58:37]W:	 [Step 1/1]     main()
[23:58:37]W:	 [Step 1/1]   File "./contrib/teamcity/build-configurations.py", line 559, in main
[23:58:37]W:	 [Step 1/1]     script_dir, config_path, args.build)
[23:58:37]W:	 [Step 1/1]   File "./contrib/teamcity/build-configurations.py", line 59, in __init__
[23:58:37]W:	 [Step 1/1]     self.load(build_name)
[23:58:37]W:	 [Step 1/1]   File "./contrib/teamcity/build-configurations.py", line 82, in load
[23:58:37]W:	 [Step 1/1]     self.name, list(config.keys())
[23:58:37]W:	 [Step 1/1] AssertionError: build-debug is not a valid build identifier. Valid identifiers are ['templates', 'builds']
[23:58:37]W:	 [Step 1/1] mv: missing destination file operand after '/results'
[23:58:37]W:	 [Step 1/1] Try 'mv --help' for more information.
[23:58:44]W:	 [Step 1/1] Process exited with code 1
[23:58:44]E:	 [Step 1/1] Process exited with code 1 (Step: Command Line)
[23:58:44]E:	 [Step 1/1] Step Command Line failed
[23:58:45]E: Ant JUnit report watcher
[23:58:45]E:	 [Ant JUnit report watcher] No reports found for paths:
[23:58:45]E:	 [Ant JUnit report watcher] +:results/test_bitcoin.xml
[23:58:45]E:	 [Ant JUnit report watcher] +:results/**/junit_results*.xml
[23:58:45] : Publishing internal artifacts (1s)
[23:58:46] :	 [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[23:58:46] :	 [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[23:58:45]W: Publishing artifacts (1s)
[23:58:45] :	 [Publishing artifacts] Collecting files to publish: [+:results/**/junit_results*.xml]
[23:58:45]W:	 [Publishing artifacts] Artifacts path 'results/**/junit_results*.xml' not found
[23:58:47] : Build finished
deadalnix requested changes to this revision.Oct 20 2020, 00:02
deadalnix added a subscriber: deadalnix.

Back to you, CI is busted.

This revision now requires changes to proceed.Oct 20 2020, 00:02

Rebase so that CI passes with the new build-debug config

This revision is now accepted and ready to land.Oct 20 2020, 14:05