Skip to content

Run the tests again, for the first time since 2021 - #33

Merged
NiKrause merged 1 commit into
mainfrom
ci/tests-workflow
Sep 18, 2026
Merged

NiKrause merged 1 commit into
mainfrom
ci/tests-workflow

Conversation

@NiKrause

Copy link
Copy Markdown
Collaborator

This repository has had no CI since July 2021 — 0 workflows, 0 runs.

The .travis.yml it inherited stopped working when Travis ended its free open-source tier, and it was already broken before that: its tarball job still does

- git clone https://github.com/$TRAVIS_REPO_SLUG.git && cd electrum-nmc

electrum-nmc is the Namecoin repository this was forked from. It changes into a directory that never existed here. Upstream Electrum moved to GitHub Actions after our fork point (4.1.5 was still on Travis), so there was nothing to inherit either.

What that cost is on the record from this week: a broken quotes contract in exchange_rate.py made test_wallet.py hang rather than fail — and TestFiat already encoded the correct contract (self.quotes = {'TEST': rate}). It sat there for years.

What runs

job
Flake8 E9,F63,F7,F82 — the old Travis selection: syntax errors and undefined names
Unit tests 20 of 30 modules, 183 tests, green

Verified end to end in a clean python:3.9-slim-bookworm container, every step exactly as written — libsecp256k1 built from the pinned commit in contrib/make_libsecp256k1.sh, dependencies installed, linter clean, tests passing in 47 s.

Modules are selected by exclusion, so a newly added test file is covered without touching the workflow.

Two things had to be fixed to get there

protobuf had no upper bound. contrib/requirements/requirements.txt asked for protobuf>=3.12, and 3.21 rewrote the runtime so it refuses the _pb2.py files generated here:

If this call came from a _pb2.py file, your generated code is out of date
and must be regenerated with protoc >= 3.19.0.

A fresh pip install -r contrib/requirements/requirements.txt today produces a package that imports but cannot parse a payment request. That is a latent breakage independent of CI. Pinned to <3.21; regenerating the protos with protoc ≥ 3.19 would lift it.

flake8's --select matches by prefix. F82 quietly selects F824 as well, which reports six redundant global/nonlocal statements and would have made the linter red on day one. Ignored explicitly rather than by accident, and the six are written up in #32 — four are plain deletions, two need a partial edit, so they are follow-up work rather than something to fix on the way past.

What is not covered

Ten modules, 98 tests, all failing on Bitcoin test vectors inherited at the fork:

AssertionError: 'dc1qx94dutas7ysn2my645cyttujrms5d9p5f0p2aw'
             != 'bc1qx94dutas7ysn2my645cyttujrms5d9p57f6aam'

WalletFileException: The addresses in this wallet are not Doichain addresses.

As far as I could tell not one of them is a real defect — the second one is the wallet behaving correctly. Each needs a vector regenerated for this chain, and for the tests whose purpose is to pin address encoding that cannot be done by deriving it from the code under test without the test becoming circular. #32 has the full table and a suggested order, cheapest first. Take a module off the EXCLUDE list as each is done.

Deliberately not included: the Windows, Android, AppImage, macOS and tarball builds the old Travis file described. Those belong in a release workflow, not on every push.

🤖 Generated with Claude Code

This repository has had no CI since July 2021. The .travis.yml it inherited
stopped working when Travis ended its free open-source tier, and it was
already broken before that -- its tarball job changes into electrum-nmc, the
Namecoin repository this was forked from. Upstream Electrum moved to GitHub
Actions after our fork point, so there was nothing to inherit either. 0
workflows, 0 runs.

What that cost is on the record: a broken quotes contract in exchange_rate.py
made test_wallet.py *hang* rather than fail, and the test it hung in already
encoded the correct contract. Nobody saw it for years.

The workflow runs flake8 and 20 of the 30 test modules -- 183 tests, green.
Verified end to end in a clean container, every step as written: libsecp256k1
built from the pinned commit in contrib/make_libsecp256k1.sh, dependencies
installed, linter clean, tests passing.

Two things had to be fixed to get there:

- contrib/requirements/requirements.txt asked for protobuf>=3.12 with no upper
  bound, and 3.21 rewrote the runtime so it refuses the _pb2.py files generated
  here. A fresh `pip install -r` produced a package that imports but cannot
  parse a payment request. Pinned to <3.21; regenerating the protos with
  protoc >= 3.19 would lift it.
- flake8's --select matches by prefix, so E9,F63,F7,F82 quietly selects F824 as
  well. Ignored explicitly, with the six places it reports left as follow-up.

Modules are picked by exclusion, so a new test file is covered without
touching this workflow. The ten excluded ones fail on Bitcoin test vectors
inherited at the fork -- addresses beginning bc1 rather than dc1, Bitcoin WIF
keys, wallet files the wallet correctly refuses to open. 98 tests, and as far
as I could tell not one a real defect; each needs a vector regenerated for
this chain without deriving it from the code under test. Tracked separately.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@NiKrause
NiKrause merged commit 169896e into main Sep 18, 2026
4 checks passed
@NiKrause NiKrause mentioned this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant