DFE-Digital / DFE-Digital/dfe-analytics-dotnet
Add a regression test for incremental builds
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2
- Forks
- 1
- Avg merge
- 23m
- Merged PRs (30d)
- 2
Description
PR #66 fixes incremental builds by adding WriteOnlyWhenDifferent="true" to the WriteLinesToFile call in CreateDfeAnalyticsDesignTimeServicesClass. It shipped without a regression test.
Both test projects are plain C# xUnit and there is no MSBuild/targets test harness to extend. Adding one means building fixture projects from inside a test run and diffing timestamps, which is genuinely new infrastructure — not worth holding a one-attribute fix behind.
If we want the guard, the cheap shape is:
- a fixture
.csprojundertests/thatImports the targets file directly fromPackage/buildTransitive/rather than via a packed nupkg - build it twice with
dotnet build - assert
LastWriteTimeUtcon the generated.g.csis unchanged after the second build
Importing the targets directly is what keeps it runnable in CI without a pack-and-restore cycle.
The failure mode is slow builds rather than incorrect output, so a re-regression would be cheap and loud — this is a nice-to-have, not urgent.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the existing test projects and inspect the targets under Package/buildTransitive/. Add a fixture .csproj under tests/ that imports the targets directly, build it twice with dotnet build, and compare the generated .g.cs file's LastWriteTimeUtc. Done means the timestamp is unchanged after the second build and the test runs in CI without a pack-and-restore cycle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100