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

support unreleased Geth builds in CI #2037

Merged
merged 1 commit into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,45 @@ geth_steps: &geth_steps
- ~/.py-geth
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

geth_custom_steps: &geth_custom_steps
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- run:
name: install dependencies
command: pip install --user tox
- run:
name: use a pre-built geth binary
command: |
mkdir -p $HOME/.ethash
export GOROOT=/usr/local/go
echo $GETH_VERSION
export GETH_BINARY="./custom_geth"
echo 'export GETH_BINARY="./custom_geth"' >> $BASH_ENV
curl -O https://storage.googleapis.com/golang/go1.14.2.linux-amd64.tar.gz
tar xvf go1.14.2.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
sudo apt-get update;
sudo apt-get install -y build-essential;
./custom_geth version
./custom_geth makedag 0 $HOME/.ethash
- run:
name: run tox
command: ~/.local/bin/tox -r
- save_cache:
paths:
- .tox
- ~/.cache/pip
- ~/.local
- ./eggs
- ~/.ethash
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

ethpm_steps: &ethpm_steps
working_directory: ~/repo
steps:
Expand Down
26 changes: 26 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,32 @@ Geth fixtures
you may again include the ``GETH_BINARY`` environment variable.


CI testing with a nightly Geth build
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Occasionally you'll want to have CI run the test suite against an unreleased version of Geth,
for example, to test upcoming hard fork changes. The workflow described below is for testing only,
i.e., open a PR, let CI run the tests, but the changes should only be merged into master once the
Geth release is published or you have some workaround that doesn't require test fixtures built from
an unstable client.

1. Configure ``tests/integration/generate_fixtures/go_ethereum/common.py`` as needed.

2. Geth automagically compiles new builds for every commit that gets merged into the codebase.
Download the desired build from the `develop builds <https://geth.ethereum.org/downloads/>`_.

3. Build your test fixture, passing in the binary you just downloaded via ``GETH_BINARY``. Don't forget
to update the ``/tests/integration/go_ethereum/conftest.py`` file to point to your new fixture.

4. Our CI runs on Ubuntu, so download the corresponding 64-bit Linux
`develop build <https://geth.ethereum.org/downloads/>`_, then
add it to the root of your Web3.py directory. Rename the binary ``custom_geth``.

5. In ``.circleci/config.yml``, update jobs relying on ``geth_steps``, to instead use ``custom_geth_steps``.

6. Create a PR and let CI do its thing.


Parity/OpenEthereum fixtures
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions newsfragments/2037.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Detail using unreleased Geth builds in CI