letsencrypt / letsencrypt/boulder

RA test abuses global state

Open
#1,922 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/ra kind/tests
Dominant language
Go
Stars
5.8k
Forks
649
Avg merge
3d 23h
Merged PRs (30d)
24

Description

The RA unittest sets some global state (Registration, AuthzInitial, AuthzFinal) in initAuthorities. This means its test cases can't be run in parallel, but more importantly it invites errors. Instead initAuthorities should return those values for possible use in test cases. We may want to create a testCtx structure to store the large number of return values from initAuthorities.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the RA unittest and its initAuthorities function, then trace how Registration, AuthzInitial, and AuthzFinal are assigned and consumed. Refactor the test setup so initAuthorities returns these values, potentially through a testCtx structure, and verify that test cases no longer depend on shared global state.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.