Skip to content

Update GitHub Actions workflow for testing code#31

Merged
Shane32 merged 15 commits into
masterfrom
Shane32-patch-1
May 7, 2026
Merged

Update GitHub Actions workflow for testing code#31
Shane32 merged 15 commits into
masterfrom
Shane32-patch-1

Conversation

@Shane32
Copy link
Copy Markdown
Owner

@Shane32 Shane32 commented May 7, 2026

Summary by CodeRabbit

  • Chores
    • Updated CI workflows and action versions; CI now runs across multiple OSes for broader coverage.
  • Tests
    • Improved test stability by skipping drawing/image-specific tests on Linux to avoid platform-specific false failures.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Warning

Rate limit exceeded

@Shane32 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 125a13d0-0848-4c29-bcbb-10adbb265a69

📥 Commits

Reviewing files that changed from the base of the PR and between 5d1aafb and 8599088.

📒 Files selected for processing (6)
  • .github/workflows/test-code.yml
  • EPPlusTest/DTS_FailingTests.cs
  • EPPlusTest/DrawingTest.cs
  • EPPlusTest/EPPlusTest.Core.csproj
  • EPPlusTest/TestBase.cs
  • EPPlusTest/WorkSheetTests.cs
📝 Walkthrough

Walkthrough

CI workflows are modernized by bumping several action versions and switching the test runner from a pinned ubuntu-20.04 to ubuntu-latest. Test suites were updated to detect Linux and mark drawing/image-related tests as inconclusive; one test was renamed and adjusted to use an in-memory package flow.

Changes

CI Workflow Updates

Layer / File(s) Summary
Runner Matrix
.github/workflows/test-code.yml
Job OS changed from ubuntu-20.04 to ubuntu-latest (Windows preserved).
Action Version Bumps (checkout & dotnet)
.github/workflows/test-code.yml, .github/workflows/build.yml, .github/workflows/publish.yml, .github/workflows/test-documentation.yml
actions/checkout upgraded v4→v6 and actions/setup-dotnet v4→v5 across workflows.
MSBuild & Artifact/upload/runtime tooling
.github/workflows/build.yml, .github/workflows/build.yml (builddocs), .github/workflows/publish.yml, .github/workflows/test-documentation.yml
microsoft/setup-msbuild upgraded v1.1→v3 where used; actions/upload-artifact upgraded v4→v7; actions/github-script upgraded v6→v9 in publish workflow.
Behavior
.github/workflows/*
No other job commands, .NET matrix values, or build/test logic were changed.

Test Suite: Drawing/Image Linux Skips and Test Adjustment

Layer / File(s) Summary
Imports / Platform API
EPPlusTest/DTS_FailingTests.cs, EPPlusTest/DrawingTest.cs, EPPlusTest/WorkSheetTests.cs
Added System.Runtime.InteropServices and other using directives to enable OS detection and drawing namespaces.
Suite-level Linux Guards
EPPlusTest/DrawingTest.cs EPPlusTest/WorkSheetTests.cs
RunDrawingTests and RunWorksheetTests now check RuntimeInformation.IsOSPlatform(OSPlatform.Linux) and call Assert.Inconclusive(...) to skip drawing-related tests on Linux.
Per-test Linux Guards
EPPlusTest/WorkSheetTests.cs, EPPlusTest/DTS_FailingTests.cs
Image/drawing-specific tests (SetBackground, SetHeaderFooterImage, others) now include Linux guards that mark them inconclusive.
Test behavior & flow change
EPPlusTest/DTS_FailingTests.cs
Renamed/rewrote DeleteWorksheetWithReferencedImageCopyAndDeleteWorksheetWithImage; test now builds workbook in a fresh MemoryStream, copies worksheet, deletes original, and saves, instead of save/reopen flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title partially captures the main changes but is incomplete. While it mentions updating GitHub Actions workflows, it omits the significant test modifications (Linux platform skips for drawing tests) that constitute a substantial part of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Shane32-patch-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Shane32
Copy link
Copy Markdown
Owner Author

Shane32 commented May 7, 2026

@copilot Identify all of the failed tests. Alter those tests so that they are skipped on Linux. (The tests should still run on Windows.)

Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/82b21e3a-2032-449f-bbcd-44030b17918b

Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented May 7, 2026

@copilot Identify all of the failed tests. Alter those tests so that they are skipped on Linux. (The tests should still run on Windows.)

Done in commit 5d1aafb. I identified all six failing Linux tests from the workflow logs and updated them to call Assert.Inconclusive on Linux so they are skipped there while still executing on Windows.

Copilot finished work on behalf of Shane32 May 7, 2026 03:15
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/publish.yml (1)

43-43: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

actions/upload-artifact version inconsistency — line 43 was not bumped.

Within this same workflow, the NuGet packages upload step (line 43) still uses actions/upload-artifact@v4, while the documentation upload step (line 66) was upgraded to v7. This leaves the workflow in a mixed-version state.

🛠️ Proposed fix
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@v7
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish.yml at line 43, The workflow has a mixed version
for the upload-artifact action: the NuGet packages upload step still uses
actions/upload-artifact@v4 while the docs upload step was bumped to v7; update
the NuGet upload step (the uses: actions/upload-artifact entry) to
actions/upload-artifact@v7 to match the other step, ensuring any inputs/flags
used by the NuGet upload in that step remain compatible with v7 and adjust them
if the action's interface changed.
🧹 Nitpick comments (1)
EPPlusTest/WorkSheetTests.cs (1)

43-46: ⚡ Quick win

Blanket Linux skip in RunWorksheetTests() over-skips non-drawing tests.

The early return on lines 43–46 causes the entire RunWorksheetTests integration suite — including unrelated tests like InsertDeleteTestRows, LoadData, StyleFill, RichTextCells, CreatePivotTable, and ~25 others — to be skipped on Linux. Only the three drawing-specific calls (PictureURL, AutoFitColumns, SetHeaderFooterImage) actually require GDI+.

The guard was likely added to prevent AssertInconclusiveException from propagating when SetHeaderFooterImage() (which now has its own Linux guard) is called at line 91. The targeted fix is to remove the blanket guard from RunWorksheetTests() and instead wrap only the drawing calls inline:

♻️ Proposed targeted fix for `RunWorksheetTests()`
-        if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
-        {
-            Assert.Inconclusive("Skipping worksheet integration tests on Linux.");
-        }
-
         InsertDeleteTestRows();
         ...
 `#if` !NoDrawing
-        PictureURL();
+        if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+            PictureURL();
 `#endif`
         ...
 `#if` !NoDrawing
-        AutoFitColumns();
+        if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+            AutoFitColumns();
 `#endif`
         ...
 `#if` !NoDrawing
-        SetHeaderFooterImage();
+        if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+            SetHeaderFooterImage();
 `#endif`

The individual Linux guards on SetBackground() (line 2283) and SetHeaderFooterImage() (line 2298) remain necessary for direct [TestMethod] invocations and should be kept regardless.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@EPPlusTest/WorkSheetTests.cs` around lines 43 - 46, The RunWorksheetTests()
method currently returns early on Linux, over-skipping many non-drawing tests;
remove the blanket RuntimeInformation.IsOSPlatform(OSPlatform.Linux) guard in
RunWorksheetTests() and instead wrap only the drawing-specific calls
(PictureURL, AutoFitColumns, SetHeaderFooterImage) with individual Linux guards
that call Assert.Inconclusive when on Linux; leave existing Linux guards on
SetBackground() and the SetHeaderFooterImage() test method intact so direct
[TestMethod] invocations still short-circuit on Linux.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/publish.yml:
- Line 43: The workflow has a mixed version for the upload-artifact action: the
NuGet packages upload step still uses actions/upload-artifact@v4 while the docs
upload step was bumped to v7; update the NuGet upload step (the uses:
actions/upload-artifact entry) to actions/upload-artifact@v7 to match the other
step, ensuring any inputs/flags used by the NuGet upload in that step remain
compatible with v7 and adjust them if the action's interface changed.

---

Nitpick comments:
In `@EPPlusTest/WorkSheetTests.cs`:
- Around line 43-46: The RunWorksheetTests() method currently returns early on
Linux, over-skipping many non-drawing tests; remove the blanket
RuntimeInformation.IsOSPlatform(OSPlatform.Linux) guard in RunWorksheetTests()
and instead wrap only the drawing-specific calls (PictureURL, AutoFitColumns,
SetHeaderFooterImage) with individual Linux guards that call Assert.Inconclusive
when on Linux; leave existing Linux guards on SetBackground() and the
SetHeaderFooterImage() test method intact so direct [TestMethod] invocations
still short-circuit on Linux.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0373f993-db9b-4a42-b829-3c1c6627c0ef

📥 Commits

Reviewing files that changed from the base of the PR and between 7ddebeb and 5d1aafb.

📒 Files selected for processing (6)
  • .github/workflows/build.yml
  • .github/workflows/publish.yml
  • .github/workflows/test-documentation.yml
  • EPPlusTest/DTS_FailingTests.cs
  • EPPlusTest/DrawingTest.cs
  • EPPlusTest/WorkSheetTests.cs

@Shane32
Copy link
Copy Markdown
Owner Author

Shane32 commented May 7, 2026

@copilot Adjust the tests to not run .NET Core 2.1 or .NET Core 3.1 tests while running on Linux. Adjust the workflow that runs tests to not install .NET Core 2.1 or 3.1 on the linux runner.

Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/f9c69196-04f3-4815-b2e1-ef557965f6cf

Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented May 7, 2026

@copilot Adjust the tests to not run .NET Core 2.1 or .NET Core 3.1 tests while running on Linux. Adjust the workflow that runs tests to not install .NET Core 2.1 or 3.1 on the linux runner.

Implemented in commit 2a84289. Linux now targets only net6.0/net8.0 in EPPlusTest.Core.csproj, and the test workflow on ubuntu-latest installs only .NET 6/8 (2.1/3.1 setup runs only on non-Linux runners).

Comment thread .github/workflows/test-code.yml
Copilot finished work on behalf of Shane32 May 7, 2026 03:37
Comment thread .github/workflows/test-code.yml
Comment thread .github/workflows/test-code.yml Outdated
Comment thread .github/workflows/test-code.yml Outdated
Comment thread .github/workflows/test-code.yml Outdated
Comment thread .github/workflows/test-code.yml Outdated
Co-authored-by: Shane Krueger <shane@acdmail.com>
Comment thread EPPlusTest/EPPlusTest.Core.csproj Outdated
@Shane32
Copy link
Copy Markdown
Owner Author

Shane32 commented May 7, 2026

@copilot fix build errors for the .net framework build:

Error: D:\a\EPPlus\EPPlus\EPPlusTest\WorkSheetTests.cs(43,17): error CS0103: The name 'RuntimeInformation' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\WorkSheetTests.cs(43,49): error CS0103: The name 'OSPlatform' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\DrawingTest.cs(27,17): error CS0103: The name 'RuntimeInformation' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\DrawingTest.cs(27,49): error CS0103: The name 'OSPlatform' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\DTS_FailingTests.cs(19,17): error CS0103: The name 'RuntimeInformation' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\DTS_FailingTests.cs(19,49): error CS0103: The name 'OSPlatform' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\DTS_FailingTests.cs(45,17): error CS0103: The name 'RuntimeInformation' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\DTS_FailingTests.cs(45,49): error CS0103: The name 'OSPlatform' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\WorkSheetTests.cs(2283,17): error CS0103: The name 'RuntimeInformation' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\WorkSheetTests.cs(2283,49): error CS0103: The name 'OSPlatform' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\WorkSheetTests.cs(2298,17): error CS0103: The name 'RuntimeInformation' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]
Error: D:\a\EPPlus\EPPlus\EPPlusTest\WorkSheetTests.cs(2298,49): error CS0103: The name 'OSPlatform' does not exist in the current context [D:\a\EPPlus\EPPlus\EPPlusTest\EPPlusTest.Core.csproj::TargetFramework=net462]

(check the csproj/workflow to see which platforms it's supposed to be running on)

Copilot AI and others added 3 commits May 7, 2026 03:47
Copy link
Copy Markdown

Copilot AI commented May 7, 2026

@copilot fix build errors for the .net framework build:

...

Fixed in commit 7cc2079. I removed direct RuntimeInformation/OSPlatform usage from the affected tests and switched those Linux skip guards to a shared TestPlatform helper that compiles on net462 while preserving Linux-only skip behavior on modern targets.

Copilot finished work on behalf of Shane32 May 7, 2026 03:51
Comment thread EPPlusTest/TestBase.cs Outdated
@Shane32 Shane32 merged commit a47c15a into master May 7, 2026
4 checks passed
@Shane32 Shane32 deleted the Shane32-patch-1 branch May 7, 2026 04:04
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