Skip to content

Commit 8b00c94

Browse files
Every test class says its area, and CI reports the suite's time by area (#1623)
The Area trait was on most test classes and nothing read it, so nothing noticed the classes without one: 22 files when #1183 was filed, 37 now. AreaTraitTest fails and names every test class with no [Trait("Area", …)], and each of the 37 now carries the area its folder already uses. The C# Test job's Ubuntu leg also writes a trx, and `dotnet run AreaTimes` in Sources/Utils/Utils adds a table of time by area to the job summary. The area is read from the test assembly, since a trx names a test's class and not its traits; a class with none is counted as (none), so the table adds up to the whole run. Closes #1183. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 009003c commit 8b00c94

40 files changed

Lines changed: 229 additions & 1 deletion

‎.github/workflows/CSharpTest.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ jobs:
4040
- name: Test if not to send
4141
if: ${{ matrix.os != 'windows-latest' }}
4242
run: |
43-
dotnet test "Sources/Tests/UnitTests" -c Release -l GitHubActions /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
43+
dotnet test "Sources/Tests/UnitTests" -c Release -l GitHubActions -l "trx;LogFileName=results.trx" --results-directory "Sources/Tests/UnitTests/TestResults" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
44+
45+
# Where the suite's time goes, by the Area trait every test class carries, written to the
46+
# job's summary. One leg is enough to see the breakdown, and running the tool builds the
47+
# library once more. https://github.com/asc-community/AngouriMath/issues/1183
48+
- name: 'Time by area'
49+
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
50+
run: dotnet run AreaTimes
51+
working-directory: Sources/Utils/Utils
4452

4553
- name: Test if to send
4654
if: ${{ matrix.os == 'windows-latest' }}

‎Sources/Tests/UnitTests/Algebra/EquationWithoutTheUnknownTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace AngouriMath.Tests.Algebra
1919
/// <c>x</c> satisfies it, and every <c>x</c> does whenever the two sides happen to be
2020
/// equal. https://github.com/asc-community/AngouriMath/issues/278
2121
/// </summary>
22+
[Trait("Area", "Algebra")]
2223
public sealed class EquationWithoutTheUnknownTest
2324
{
2425
/// <summary>

‎Sources/Tests/UnitTests/Algebra/PythagoreanEquationRewriteTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace AngouriMath.Tests.Algebra
2626
/// <c>sin(x)^2 + sin(x) = 0</c> has always answered in arcsines. The mixed form simply
2727
/// never became one.
2828
/// </remarks>
29+
[Trait("Area", "Algebra")]
2930
public sealed class PythagoreanEquationRewriteTest
3031
{
3132
/// <summary>

‎Sources/Tests/UnitTests/Calculus/BinomialIdentitiesTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace AngouriMath.Tests.Calculus
2121
/// second form), the parallel summation (Prob 8.9.19) and Vandermonde along the upper
2222
/// indices (Prob 8.9.18). <see href="https://github.com/asc-community/AngouriMath/issues/1409"/>
2323
/// </summary>
24+
[Trait("Area", "Calculus")]
2425
public sealed class BinomialIdentitiesTest
2526
{
2627
/// <summary>The closed form against the sum written out, at small bounds and one past the expansion's hundred terms.</summary>

‎Sources/Tests/UnitTests/Calculus/BinomialSumTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace AngouriMath.Tests.Calculus
1717
/// https://github.com/asc-community/AngouriMath/issues/1212, question II.3: a binomial sum
1818
/// with a power or a trigonometric weight is the binomial theorem read backwards.
1919
/// </summary>
20+
[Trait("Area", "Calculus")]
2021
public sealed class BinomialSumTest
2122
{
2223
private const string Binomial = "N! / (k! * (N - k)!)";

‎Sources/Tests/UnitTests/Calculus/BreakpointIntegrationTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace AngouriMath.Tests.Calculus
1818
/// through an antiderivative that holds the case or the step constant across them. Question
1919
/// I.2 of https://github.com/asc-community/AngouriMath/issues/1212, and the review of #1215.
2020
/// </summary>
21+
[Trait("Area", "Calculus")]
2122
public sealed class BreakpointIntegrationTest
2223
{
2324
// ---- a piecewise: finitely many breakpoints ---------------------------------------------

‎Sources/Tests/UnitTests/Calculus/ConstantRateIntegrandTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace AngouriMath.Tests.Calculus
2323
/// gathering of two powers of one base turns <c>e^x * e^(-x)</c> into exactly this
2424
/// shape -- but the defect predates it and is reachable by writing the exponent out.
2525
/// </summary>
26+
[Trait("Area", "Calculus")]
2627
public sealed class ConstantRateIntegrandTest
2728
{
2829
/// <summary>

‎Sources/Tests/UnitTests/Calculus/DivergentSeriesTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace AngouriMath.Tests.Calculus
1818
/// nth-term test, asked for on the review of
1919
/// https://github.com/asc-community/AngouriMath/pull/1218.
2020
/// </summary>
21+
[Trait("Area", "Calculus")]
2122
public sealed class DivergentSeriesTest
2223
{
2324
[Theory]

‎Sources/Tests/UnitTests/Calculus/ExponentialSeriesTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace AngouriMath.Tests.Calculus
1717
/// https://github.com/asc-community/AngouriMath/issues/1212, question I.1: a summation to
1818
/// +oo of a polynomial times a power over a factorial of the index is a closed form in e.
1919
/// </summary>
20+
[Trait("Area", "Calculus")]
2021
public sealed class ExponentialSeriesTest
2122
{
2223
private static void AgreesTo(string expected, Entity actual, int digits = 25)

‎Sources/Tests/UnitTests/Calculus/ExtremumTest.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace AngouriMath.Tests.Calculus
1717
/// <c>max(f(t), t in S)</c>, <c>min</c>, <c>argmax</c> and <c>argmin</c>: the extremum of an
1818
/// expression over a set, as binders. https://github.com/asc-community/AngouriMath/issues/1212
1919
/// </summary>
20+
[Trait("Area", "Calculus")]
2021
public sealed class ExtremumTest
2122
{
2223
// The sheet's question I.6: the area of a projectile's flight is largest at pi/3.

0 commit comments

Comments
 (0)