Skip to content

Fix SOURCE_DATE_EPOCH tests when the variable is already set - #872

Merged
badboy merged 1 commit into
mozilla:mainfrom
andersk:source-date-epoch-tests
Oct 21, 2026
Merged

badboy merged 1 commit into
mozilla:mainfrom
andersk:source-date-epoch-tests

Conversation

@andersk

@andersk andersk commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

test_expire_epoch_can_be_overriden assumed SOURCE_DATE_EPOCH was unset on entry, so it failed in reproducible build environments (such as Nixpkgs or Debian) that export it, typically as some date before the test's 2023-12-31 expiry. Use monkeypatch to clear it first, and to set it in both SOURCE_DATE_EPOCH tests so the environment is restored even if an assertion fails.

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • make test runs without emitting any warnings
    • make lint runs without emitting any errors
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry to CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to language binding APIs are noted explicitly

@andersk
andersk requested a review from a team as a code owner October 20, 2026 21:50
@andersk
andersk requested review from travis79 and removed request for a team October 20, 2026 21:50
@badboy
badboy self-requested a review October 21, 2026 09:04
@badboy
badboy enabled auto-merge (rebase) October 21, 2026 11:29
auto-merge was automatically disabled October 21, 2026 11:33

Rebase failed

test_expire_epoch_can_be_overriden assumed SOURCE_DATE_EPOCH was unset
on entry, so it failed in reproducible build environments (such as
Nixpkgs or Debian) that export it, typically as some date before the
test's 2023-12-31 expiry. Use monkeypatch to clear it first, and to set
it in both SOURCE_DATE_EPOCH tests so the environment is restored even
if an assertion fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@badboy
badboy force-pushed the source-date-epoch-tests branch from 9a57d27 to 7a7f20c Compare October 21, 2026 12:15
@badboy

badboy commented Oct 21, 2026

Copy link
Copy Markdown
Member

Rebased now to fix the merge conflict in the changelog

@badboy
badboy enabled auto-merge (rebase) October 21, 2026 12:15
@badboy
badboy merged commit 556965d into mozilla:main Oct 21, 2026
12 checks passed
@andersk
andersk deleted the source-date-epoch-tests branch October 21, 2026 12:18
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.

2 participants