• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vocdoni / vocdoni-node / 7350943765
63%

Build:
DEFAULT BRANCH: main
Ran 28 Dec 2023 08:23PM UTC
Jobs 2
Files 171
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Dec 2023 08:16PM UTC coverage: 62.163% (-0.03%) from 62.19%
7350943765

push

github

p4u
cmd/node: refuse to start if viper shadows keys

If a node is started with VOCDONI_VOCHAIN=foo,
then all flags or config keys under the vochain group are broken.
They don't bind properly to the config type,
and their defaults don't get applied properly.

This then leads to confusing failures, since values are left empty:

    $ VOCDONI_VOCHAIN=dev go run ./cmd/node
    [...]
    2023-12-25T00:05:54.798+01:00 FTL node/main.go:449 > invalid P2PListen "": missing port in address
    goroutine 1 [running]:
    runtime/debug.Stack()
    	/home/mvdan/tip/src/runtime/debug/stack.go:24 +0x5e
    go.vocdoni.io/dvote/log.Fatal({0xc0006bbf20, 0x1, 0x1})
    	/home/mvdan/src/voc/log/log.go:212 +0x65
    main.main()
    	/home/mvdan/src/voc/cmd/node/main.go:449 +0xc26

Don't let the node start if we know this would happen via an env var.
It's technically still possible for this to happen via the YAML config,
but it feels far less likely to be the case.

We can avoid repetition in the code by looping over the groups of
config key prefixes we use. It turns out that viper is always
case insensitive, so we don't have to worry about "tls" vs "TLS".

While here, add context to these SplitHostPort errors,
since the lone "missing port in address" error seemed confusing.

11 of 15 new or added lines in 2 files covered. (73.33%)

6 existing lines in 2 files now uncovered.

14850 of 23889 relevant lines covered (62.16%)

39943.33 hits per line

Jobs
ID Job ID Ran Files Coverage
1 integration - 7350943765.1 28 Dec 2023 08:23PM UTC 0
52.06
GitHub Action Run
2 unit - 7350943765.2 28 Dec 2023 08:23PM UTC 0
51.57
GitHub Action Run
Source Files on build 7350943765
Detailed source file information is not available for this build.
  • Back to Repo
  • aad2c6b7 on github
  • Prev Build on main (#7299247841)
  • Next Build on main (#7384727601)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc