Skip to content

Commit 041e517

Browse files
committed
support unreleased Geth builds in CI
1 parent b4f9336 commit 041e517

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.circleci/config.yml

+39
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,45 @@ geth_steps: &geth_steps
110110
- ~/.py-geth
111111
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
112112

113+
geth_custom_steps: &geth_custom_steps
114+
working_directory: ~/repo
115+
steps:
116+
- checkout
117+
- restore_cache:
118+
keys:
119+
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
120+
- run:
121+
name: install dependencies
122+
command: pip install --user tox
123+
- run:
124+
name: use a pre-built geth binary
125+
command: |
126+
mkdir -p $HOME/.ethash
127+
export GOROOT=/usr/local/go
128+
echo $GETH_VERSION
129+
export GETH_BINARY="./custom_geth"
130+
echo 'export GETH_BINARY="./custom_geth"' >> $BASH_ENV
131+
curl -O https://storage.googleapis.com/golang/go1.14.2.linux-amd64.tar.gz
132+
tar xvf go1.14.2.linux-amd64.tar.gz
133+
sudo chown -R root:root ./go
134+
sudo mv go /usr/local
135+
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
136+
sudo apt-get update;
137+
sudo apt-get install -y build-essential;
138+
./custom_geth version
139+
./custom_geth makedag 0 $HOME/.ethash
140+
- run:
141+
name: run tox
142+
command: ~/.local/bin/tox -r
143+
- save_cache:
144+
paths:
145+
- .tox
146+
- ~/.cache/pip
147+
- ~/.local
148+
- ./eggs
149+
- ~/.ethash
150+
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
151+
113152
ethpm_steps: &ethpm_steps
114153
working_directory: ~/repo
115154
steps:

docs/contributing.rst

+26
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,32 @@ Geth fixtures
265265
you may again include the ``GETH_BINARY`` environment variable.
266266

267267

268+
CI testing with a nightly Geth build
269+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270+
271+
Occasionally you'll want to have CI run the test suite against an unreleased version of Geth,
272+
for example, to test upcoming hard fork changes. The workflow described below is for testing only,
273+
i.e., open a PR, let CI run the tests, but the changes should only be merged into master once the
274+
Geth release is published or you have some workaround that doesn't require test fixtures built from
275+
an unstable client.
276+
277+
1. Configure ``tests/integration/generate_fixtures/go_ethereum/common.py`` as needed.
278+
279+
2. Geth automagically compiles new builds for every commit that gets merged into the codebase.
280+
Download the desired build from the `develop builds <https://geth.ethereum.org/downloads/>`_.
281+
282+
3. Build your test fixture, passing in the binary you just downloaded via ``GETH_BINARY``. Don't forget
283+
to update the ``/tests/integration/go_ethereum/conftest.py`` file to point to your new fixture.
284+
285+
4. Our CI runs on Ubuntu, so download the corresponding 64-bit Linux
286+
`develop build <https://geth.ethereum.org/downloads/>`_, then
287+
add it to the root of your Web3.py directory. Rename the binary ``custom_geth``.
288+
289+
5. In ``.circleci/config.yml``, update jobs relying on ``geth_steps``, to instead use ``custom_geth_steps``.
290+
291+
6. Create a PR and let CI do its thing.
292+
293+
268294
Parity/OpenEthereum fixtures
269295
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270296

newsfragments/2037.doc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Detail using unreleased Geth builds in CI

0 commit comments

Comments
 (0)