Skip to content

Go to NSubstitute 4.2.2, why not later, let me check... - #2088

Closed
NickJosevski wants to merge 1 commit into
mainfrom
nj/nsub-align-4.2.2
Closed

Go to NSubstitute 4.2.2, why not later, let me check...#2088
NickJosevski wants to merge 1 commit into
mainfrom
nj/nsub-align-4.2.2

Conversation

@NickJosevski

@NickJosevski NickJosevski commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

All nine test projects now reference NSubstitute 4.2.2. It was 2.0.3

Collapses the last inconsistent test dependency: NSubstitute was pinned at
2.0.3 in Calamari.Tests, 4.2.1 in Calamari.AzureScripting.Tests and
Calamari.ConsolidateCalamariPackages.Tests, and 4.2.2 in the remaining six
test projects. All nine now reference 4.2.2.

This was deliberately split out of #2080 because Calamari.Tests jumping
2.0.3 -> 4.2.2 is a two-major bump across the 82 files in that project which
use NSubstitute, and that carries materially more risk than the Newtonsoft
and Shouldly alignment it shipped alongside.

The risk did not materialise. Verified by differential test run rather than
by compilation alone, since NSubstitute's breaking changes surface at runtime:

- All three changed projects compile with 0 errors. No NSubstitute-related or
  obsolescence warnings are introduced - the SYSLIB0014/SYSLIB0028 warnings in
  the build are pre-existing in Calamari.Shared and unrelated.
- A 907-test sweep across the NSubstitute-heavy fixtures (ArgoCD, CommitToGit,
  PackageRetention, StructuredVariables, Deployment.Conventions, Retention,
  Variables, ConfigurationTransforms, InputSubstitution, NodeExecutor,
  FindPackage) was run on this branch and again on a pristine main. Both give
  852 passed / 46 failed / 9 skipped, and the sets of failing test names are
  byte-identical - so there are no regressions and no newly-passing tests
  masking a change in behaviour.
- Calamari.ConsolidateCalamariPackages.Tests gives 2 passed / 18 failed, again
  matching its pristine-main baseline.

The 46 failures are environmental and pre-existing on both sides: 41 need
package artifacts built by build-local.sh ("The value cannot be an empty
string. (Parameter 'path')"), 4 assert Windows/UNC path rejection which
inverts on non-Windows, and the remainder need tooling absent from this
machine.

Note 4.2.2 is not current - NSubstitute has since shipped 4.3.0, 4.4.0, 5.0.0,
5.1.0, 5.3.0 and 6.0.0. This change is purely a consolidation onto the highest
version already present in the repo, so that patching NSubstitute in future is
a single-file edit. Moving to 5.x or 6.x is separate work with its own
breaking-change surface.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@NickJosevski
NickJosevski marked this pull request as ready for review July 31, 2026 03:40
@NickJosevski NickJosevski changed the title Align NSubstitute on 4.2.2 across all test projects Go to NSubstitute 4.2.2, why not later, let me check... Jul 31, 2026
@NickJosevski

Copy link
Copy Markdown
Contributor Author

Better to go to 6.0.0 see here: #2090

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