Skip to content

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Aug 13, 2019

Adds an additional Travis machine to run the functional test suite on native macOS

Homebrew is not particularly Travis compatible, but I found some useful hints here: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/11

@Sjors Sjors force-pushed the 2019/08/travis-macos branch 4 times, most recently from c155de1 to f6014d8 Compare August 13, 2019 18:05
@fanquake fanquake added the Tests label Aug 13, 2019
@Sjors Sjors changed the title Travis: run full test suite on native macOS [WIP] Travis: run full test suite on native macOS Aug 13, 2019
@Sjors Sjors marked this pull request as ready for review August 13, 2019 18:36
@Sjors Sjors force-pushed the 2019/08/travis-macos branch 7 times, most recently from c9c9198 to 4f602ce Compare August 13, 2019 19:31
@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 13, 2019

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #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.

@cvengler
Copy link
Contributor

Are there travis tests which can proof it? Like your fork?
But I generally like this idea as the current situation with tuxes on the side is a bit confusing

@fanquake
Copy link
Member

Concept ACK. Will take a look at the base PR first.

@Sjors Sjors force-pushed the 2019/08/travis-macos branch 3 times, most recently from 1e64a41 to 468621a Compare August 14, 2019 08:18
@Sjors
Copy link
Member Author

Sjors commented Aug 14, 2019

Travis is ignoring this PR and my branch atm.

@cvengler
Copy link
Contributor

Can you enable travis for your forked repository?

@Sjors
Copy link
Member Author

Sjors commented Aug 15, 2019

@emilengler I tried that, but it wasn't building there either. I'll wait until the previous PR is merged and then try again.

@cvengler
Copy link
Contributor

@Sjors Ok I will fork your repository, then remove it from the parent and try to enable travis then

@cvengler
Copy link
Contributor

@Sjors Doesn't work, take a look https://travis-ci.org/emilengler/bitcoin-sjors-test/requests.
I also forked your repo here as a playgroud, I also invited you for commit access, will delete it once it is done.

@Sjors Sjors force-pushed the 2019/08/travis-macos branch 2 times, most recently from cf63f09 to c2e4c57 Compare October 13, 2019 13:27
export LC_ALL=C.UTF-8

export HOST=x86_64-apple-darwin14
export BREW_PACKAGES="automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt qrencode librsvg pyenv ccache"
Copy link
Member

Choose a reason for hiding this comment

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

No reason to install protobuf if we're not enabling BIP70.

Copy link
Member Author

Choose a reason for hiding this comment

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

Dropped (in other branch, will push later)

Copy link
Member

Choose a reason for hiding this comment

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

If we're building/testing only once natively, we should enable everything...

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it back and enabled BIP70 in the build.

@Sjors Sjors force-pushed the 2019/08/travis-macos branch from c2e4c57 to e1e6d22 Compare October 13, 2019 20:17
@Sjors Sjors changed the title [WIP] Travis: run full test suite on native macOS Travis: run full test suite on native macOS Oct 13, 2019
@Sjors Sjors force-pushed the 2019/08/travis-macos branch 2 times, most recently from cb6b7a4 to 185c201 Compare October 14, 2019 06:48
@Sjors
Copy link
Member Author

Sjors commented Oct 14, 2019

Travis macOS passed! I added pip install zmq for the functional ZMQ tests...

pyenv was causing more headaches than it solved. There doesn't appear to be any `language: python python: '3.x'. packages available, so I'm installing via homebrew instead.

@Sjors Sjors force-pushed the 2019/08/travis-macos branch from 185c201 to 26068f3 Compare October 14, 2019 09:15
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

ACK 26068f3 (looked at the diff on GitHub)

@Sjors Sjors force-pushed the 2019/08/travis-macos branch 2 times, most recently from e7e3301 to 092d388 Compare October 14, 2019 16:46
@Sjors Sjors force-pushed the 2019/08/travis-macos branch from 092d388 to 3cd5e59 Compare October 14, 2019 18:48
Comment on lines 10 to 15
cd /usr/local/Homebrew || exit 1
git reset --hard origin/master
${CI_RETRY_EXE} brew update
Copy link
Member Author

Choose a reason for hiding this comment

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

@MarcoFalke brew update blew up on a previous run (can't find it anymore) and recommended these two lines to "fix" it.

Copy link
Member Author

Choose a reason for hiding this comment

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

It might be worth rebasing the PR for a while to see if any other surprises show up.

@Sjors Sjors force-pushed the 2019/08/travis-macos branch from 3cd5e59 to 21c1601 Compare October 14, 2019 19:15
Comment on lines +9 to +10
# Temporarily disable errexit, because Travis macOS fails without error message
set +o errexit
Copy link
Member Author

Choose a reason for hiding this comment

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

This is where your sanity gives in...

@Sjors Sjors force-pushed the 2019/08/travis-macos branch from 21c1601 to f2d3839 Compare October 14, 2019 19:33
Review hint:
git show -w

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: keneanung <keneanung@googlemail.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
@Sjors Sjors force-pushed the 2019/08/travis-macos branch from f2d3839 to 1f6c650 Compare October 14, 2019 21:12
@maflcko
Copy link
Member

maflcko commented Oct 15, 2019

re-ACK 1f6c650

Comment on lines +10 to +14
set +o errexit
pushd /usr/local/Homebrew || exit 1
git reset --hard origin/master
popd || exit 1
set -o errexit
Copy link
Member

Choose a reason for hiding this comment

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

What happens if you remove this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing initially because the brew cache is in a good state. But at some random other moment homebrew will be in a bad state and you'll need this.

Comment on lines +42 to +43
# Cache only .git files under "/usr/local/Homebrew" so "brew update" does not take 5min every build
# - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi
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 still needed?

The whole process takes 2 min without it: https://travis-ci.org/bitcoin/bitcoin/jobs/597848502#L100

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if it builds up any cruft over time, but if time doesn't creep up, then we can drop this.

Copy link
Member

Choose a reason for hiding this comment

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

Well it is commented out already, so I removed it in #17176

maflcko pushed a commit that referenced this pull request Oct 17, 2019
1f6c650 travis: run tests on macOS native (Sjors Provoost)

Pull request description:

  Adds an additional Travis machine to run the functional test suite on native macOS

  Homebrew is not particularly Travis compatible, but I found some useful hints here: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/11

ACKs for top commit:
  MarcoFalke:
    re-ACK 1f6c650

Tree-SHA512: 3f19a1695fac53d4d6c2033a9c20be69294e3a798c84fd9bf6ae2aa7a6d92aa1dad1f62f4ee1ada9413fe7d05ee974050fa030fd2c547f33e0d5c0a3e74f64db
@maflcko maflcko merged commit 1f6c650 into bitcoin:master Oct 17, 2019
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Post merge code review ACK 1f6c650

Since this adds homebrew, I wonder if it fixes the scripted diff lint error I ran into #13728 (comment)

Comment on lines +24 to +27
# Temporarily disable errexit, because Travis macOS fails without error message
set +o errexit
cd build || (echo "could not enter build directory"; exit 1)
set -o errexit
Copy link
Contributor

Choose a reason for hiding this comment

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

The cd command succeeds and returns an error code? I guess this is calling some travis-wrapped cd alias rather than the actual cd command? Could debug with type cd. If a workaround is necessary, it would seem nicer to wrap the workaround in a safe_cd function than repeat this errexit stuff different places.

Copy link
Member

Choose a reason for hiding this comment

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

Filed as good first issue. See #17178


mkdir -p depends/SDKs depends/sdk-sources
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe should add a comment explaining this check. I'm confused about why all of this is skipped on osx. Does the depends build not work there? It would seem cleaner to use NO_DEPENDS variable to skip depends steps than to tie the decision to the travis operating system name.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the review @ryanofsky . This check looks indeed redundant. Removed in #17176

@maflcko maflcko mentioned this pull request Oct 17, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 18, 2019
1f6c650 travis: run tests on macOS native (Sjors Provoost)

Pull request description:

  Adds an additional Travis machine to run the functional test suite on native macOS

  Homebrew is not particularly Travis compatible, but I found some useful hints here: https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/11

ACKs for top commit:
  MarcoFalke:
    re-ACK 1f6c650

Tree-SHA512: 3f19a1695fac53d4d6c2033a9c20be69294e3a798c84fd9bf6ae2aa7a6d92aa1dad1f62f4ee1ada9413fe7d05ee974050fa030fd2c547f33e0d5c0a3e74f64db
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants