From 7ddebeb1c41a455d8b98682a9810ddfc3b8b8f68 Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:00:38 -0400 Subject: [PATCH 01/15] Update GitHub Actions workflow for testing code --- .github/workflows/test-code.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 839315f0b..d845597d4 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -2,21 +2,19 @@ name: Test code on: pull_request: - branches: - - master jobs: test: strategy: matrix: - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-latest, windows-latest] name: ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup .NET Core SDKs - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: | 2.1.x From 83b1b80bf7b1a633ace327636c9c251735f012a4 Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:02:32 -0400 Subject: [PATCH 02/15] Update GitHub Actions to use newer action versions --- .github/workflows/test-documentation.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-documentation.yml b/.github/workflows/test-documentation.yml index fcf1635fc..753b761d1 100644 --- a/.github/workflows/test-documentation.yml +++ b/.github/workflows/test-documentation.yml @@ -2,21 +2,19 @@ name: Test documentation on: pull_request: - branches: - - master jobs: buildcheck: runs-on: windows-latest steps: - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup .NET Core SDKs - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: global-json-file: global.json - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v3 with: msbuild-architecture: x64 - name: Install SHFB From 217a75858f0d6f42a0af75ee9f761e31c4926520 Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:03:33 -0400 Subject: [PATCH 03/15] Update GitHub Actions to use latest action versions --- .github/workflows/publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 996e4bb47..4a4f9cbdf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ jobs: build: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check github.ref starts with 'refs/tags/' if: ${{ !startsWith(github.ref, 'refs/tags/') }} run: | @@ -25,7 +25,7 @@ jobs: echo version=$version echo "version=$version" >> $GITHUB_ENV - name: Use .NET Core SDK - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: global-json-file: global.json source-url: https://api.nuget.org/v3/index.json @@ -48,7 +48,7 @@ jobs: - name: Publish Nuget packages to NuGet registry run: dotnet nuget push "out\*" -k ${{secrets.NUGET_AUTH_TOKEN}} - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v3 with: msbuild-architecture: x64 - name: Install SHFB @@ -63,12 +63,12 @@ jobs: run: Compress-Archive -Path * -DestinationPath ..\..\out\Documentation.zip # run: zip -r ../../out/Documentation.zip . - name: Upload workflow documentation artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Documentation path: Doc/Help - name: Upload Nuget packages and documentation as release artifacts - uses: actions/github-script@v6 + uses: actions/github-script@v9 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | From f80490446e06539cf67aac93eeb5d8c4b7aee36d Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:04:14 -0400 Subject: [PATCH 04/15] Upgrade GitHub Actions to latest versions --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f7c86065..ecf0bb043 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Use .NET Core SDK - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: global-json-file: global.json source-url: https://nuget.pkg.github.com/${{ github.actor }}/index.json @@ -26,7 +26,7 @@ jobs: - name: Pack solution [Release] run: dotnet pack --no-restore --no-build -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Nuget packages path: | @@ -37,13 +37,13 @@ jobs: runs-on: windows-latest steps: - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup .NET Core SDKs - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: global-json-file: global.json - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v3 with: msbuild-architecture: x64 - name: Install SHFB @@ -56,7 +56,7 @@ jobs: working-directory: Doc run: msbuild EPPlusDoc.sln -t:rebuild -verbosity:minimal -property:Configuration=Release - name: Upload build artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Documentation path: Doc/Help From 5d1aafbd6091cf542a9200d3a2dc49894ad17a18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:14:33 +0000 Subject: [PATCH 05/15] Skip Linux-only failing drawing tests Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/82b21e3a-2032-449f-bbcd-44030b17918b Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/DTS_FailingTests.cs | 43 +++++++++++++++++++++------------- EPPlusTest/DrawingTest.cs | 28 +++++++++++++--------- EPPlusTest/WorkSheetTests.cs | 15 ++++++++++++ 3 files changed, 59 insertions(+), 27 deletions(-) diff --git a/EPPlusTest/DTS_FailingTests.cs b/EPPlusTest/DTS_FailingTests.cs index 161bdfbbe..490f26c94 100644 --- a/EPPlusTest/DTS_FailingTests.cs +++ b/EPPlusTest/DTS_FailingTests.cs @@ -1,10 +1,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OfficeOpenXml; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; namespace EPPlusTest { @@ -12,12 +13,17 @@ namespace EPPlusTest public class DTS_FailingTests { #if !NoDrawing - [TestMethod] - public void DeleteWorksheetWithReferencedImage() - { - var ms = new MemoryStream(); - using (var pck = new ExcelPackage()) - { + [TestMethod] + public void DeleteWorksheetWithReferencedImage() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Assert.Inconclusive("Skipping image worksheet tests on Linux."); + } + + var ms = new MemoryStream(); + using (var pck = new ExcelPackage()) + { var ws = pck.Workbook.Worksheets.Add("original"); ws.Drawings.AddPicture("Pic1", Properties.Resources.Test1); pck.Workbook.Worksheets.Copy("original", "copy"); @@ -33,12 +39,17 @@ public void DeleteWorksheetWithReferencedImage() } } - [TestMethod] - public void CopyAndDeleteWorksheetWithImage() - { - using (var pck = new ExcelPackage(new MemoryStream())) - { - var ws = pck.Workbook.Worksheets.Add("original"); + [TestMethod] + public void CopyAndDeleteWorksheetWithImage() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Assert.Inconclusive("Skipping image worksheet tests on Linux."); + } + + using (var pck = new ExcelPackage(new MemoryStream())) + { + var ws = pck.Workbook.Worksheets.Add("original"); ws.Drawings.AddPicture("Pic1", Properties.Resources.Test1); pck.Workbook.Worksheets.Copy("original", "copy"); pck.Workbook.Worksheets.Delete(ws); diff --git a/EPPlusTest/DrawingTest.cs b/EPPlusTest/DrawingTest.cs index 9bc18e2ec..bf8fe6e61 100644 --- a/EPPlusTest/DrawingTest.cs +++ b/EPPlusTest/DrawingTest.cs @@ -5,11 +5,12 @@ using EPPlusTest.Properties; using Microsoft.VisualStudio.TestTools.UnitTesting; using OfficeOpenXml; -using OfficeOpenXml.Drawing; -using OfficeOpenXml.Drawing.Chart; -using OfficeOpenXml.Style; -using System.Diagnostics; -using System.Reflection; +using OfficeOpenXml.Drawing; +using OfficeOpenXml.Drawing.Chart; +using OfficeOpenXml.Style; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; namespace EPPlusTest { @@ -20,12 +21,17 @@ namespace EPPlusTest [TestClass] public class DrawingTest : TestBase { - [TestMethod] - public void RunDrawingTests() - { - BarChart(); - Column(); - Cone(); + [TestMethod] + public void RunDrawingTests() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Assert.Inconclusive("Skipping drawing tests on Linux."); + } + + BarChart(); + Column(); + Cone(); Dougnut(); Drawings(); Line(); diff --git a/EPPlusTest/WorkSheetTests.cs b/EPPlusTest/WorkSheetTests.cs index 11dc2d51e..81e28532f 100644 --- a/EPPlusTest/WorkSheetTests.cs +++ b/EPPlusTest/WorkSheetTests.cs @@ -16,6 +16,7 @@ using System.Threading; using System.Globalization; using System.Threading.Tasks; +using System.Runtime.InteropServices; namespace EPPlusTest { @@ -39,6 +40,11 @@ public class WorkSheetTest : TestBase [TestMethod] public void RunWorksheetTests() { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Assert.Inconclusive("Skipping worksheet integration tests on Linux."); + } + InsertDeleteTestRows(); InsertDeleteTestColumns(); LoadData(); @@ -2274,6 +2280,11 @@ public void CreatePivotMultData() [TestMethod] public void SetBackground() { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); + } + var ws = _pck.Workbook.Worksheets.Add("backimg"); ws.BackgroundImage.Image = Properties.Resources.Test1; @@ -2284,6 +2295,10 @@ public void SetBackground() [TestMethod] public void SetHeaderFooterImage() { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); + } var ws = _pck.Workbook.Worksheets.Add("HeaderImage"); ws.HeaderFooter.OddHeader.CenteredText = "Before "; From 2a8428996f7ed3078f904e0c37edd1e382446b2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:36:10 +0000 Subject: [PATCH 06/15] Exclude netcore 2.1/3.1 on Linux test runs Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/f9c69196-04f3-4815-b2e1-ef557965f6cf Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- .github/workflows/test-code.yml | 9 +++++++-- EPPlusTest/EPPlusTest.Core.csproj | 9 ++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index d845597d4..aa1c6083e 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -17,10 +17,15 @@ jobs: uses: actions/setup-dotnet@v5 with: dotnet-version: | - 2.1.x - 3.1.x 6.0.x 8.0.x + - name: Setup legacy .NET Core SDKs + if: matrix.os != 'ubuntu-latest' + uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 2.1.x + 3.1.x - name: Install dependencies run: dotnet restore - name: Build solution [Debug] diff --git a/EPPlusTest/EPPlusTest.Core.csproj b/EPPlusTest/EPPlusTest.Core.csproj index 16119fe8b..cf65f1e30 100644 --- a/EPPlusTest/EPPlusTest.Core.csproj +++ b/EPPlusTest/EPPlusTest.Core.csproj @@ -13,9 +13,12 @@ $(NoWarn);NETSDK1023 - - netcoreapp2.1;netcoreapp3.1;net6.0;net8.0 - + + net6.0;net8.0 + + + netcoreapp2.1;netcoreapp3.1;net6.0;net8.0 + netcoreapp2.1;netcoreapp3.1;net6.0;net8.0;net462;net48;net481 From e59349b6d97f59f2392b8b53261d3264b17cf125 Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:38:34 -0400 Subject: [PATCH 07/15] Apply suggestions from code review Co-authored-by: Shane Krueger --- .github/workflows/test-code.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index aa1c6083e..5f69b2b06 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -13,19 +13,22 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v6 - - name: Setup .NET Core SDKs + - name: Setup .NET Core SDKs for Windows + if: matrix.os == 'windows-latest' uses: actions/setup-dotnet@v5 with: dotnet-version: | + 2.1.x + 3.1.x 6.0.x 8.0.x - - name: Setup legacy .NET Core SDKs - if: matrix.os != 'ubuntu-latest' + - name: Setup .NET Core SDKs on Linux + if: matrix.os == 'ubuntu-latest' uses: actions/setup-dotnet@v5 with: dotnet-version: | - 2.1.x - 3.1.x + 6.0.x + 8.0.x - name: Install dependencies run: dotnet restore - name: Build solution [Debug] From 955229b9cbf11232d89f2ef6bebb39e8f19174a7 Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:39:40 -0400 Subject: [PATCH 08/15] Apply suggestion from @Shane32 --- EPPlusTest/EPPlusTest.Core.csproj | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/EPPlusTest/EPPlusTest.Core.csproj b/EPPlusTest/EPPlusTest.Core.csproj index cf65f1e30..c96bbd36e 100644 --- a/EPPlusTest/EPPlusTest.Core.csproj +++ b/EPPlusTest/EPPlusTest.Core.csproj @@ -13,12 +13,9 @@ $(NoWarn);NETSDK1023 - - net6.0;net8.0 - - - netcoreapp2.1;netcoreapp3.1;net6.0;net8.0 - + + net6.0;net8.0 + netcoreapp2.1;netcoreapp3.1;net6.0;net8.0;net462;net48;net481 From 3d387e4491fb65bdc2525a0999eaa6c9e9641903 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:47:00 +0000 Subject: [PATCH 09/15] Fix net462 compile errors in Linux-skip test guards Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/e37315fd-7014-4323-9307-31dcb58bbbc3 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/DTS_FailingTests.cs | 5 ++--- EPPlusTest/DrawingTest.cs | 3 +-- EPPlusTest/WorkSheetTests.cs | 7 +++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/EPPlusTest/DTS_FailingTests.cs b/EPPlusTest/DTS_FailingTests.cs index 490f26c94..d08479467 100644 --- a/EPPlusTest/DTS_FailingTests.cs +++ b/EPPlusTest/DTS_FailingTests.cs @@ -5,7 +5,6 @@ using System.IO; using System.Linq; using System.Text; -using System.Runtime.InteropServices; namespace EPPlusTest { @@ -16,7 +15,7 @@ public class DTS_FailingTests [TestMethod] public void DeleteWorksheetWithReferencedImage() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (Environment.OSVersion.Platform == PlatformID.Unix) { Assert.Inconclusive("Skipping image worksheet tests on Linux."); } @@ -42,7 +41,7 @@ public void DeleteWorksheetWithReferencedImage() [TestMethod] public void CopyAndDeleteWorksheetWithImage() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (Environment.OSVersion.Platform == PlatformID.Unix) { Assert.Inconclusive("Skipping image worksheet tests on Linux."); } diff --git a/EPPlusTest/DrawingTest.cs b/EPPlusTest/DrawingTest.cs index bf8fe6e61..39c5a77b9 100644 --- a/EPPlusTest/DrawingTest.cs +++ b/EPPlusTest/DrawingTest.cs @@ -10,7 +10,6 @@ using OfficeOpenXml.Style; using System.Diagnostics; using System.Reflection; -using System.Runtime.InteropServices; namespace EPPlusTest { @@ -24,7 +23,7 @@ public class DrawingTest : TestBase [TestMethod] public void RunDrawingTests() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (Environment.OSVersion.Platform == PlatformID.Unix) { Assert.Inconclusive("Skipping drawing tests on Linux."); } diff --git a/EPPlusTest/WorkSheetTests.cs b/EPPlusTest/WorkSheetTests.cs index 81e28532f..c0f54019a 100644 --- a/EPPlusTest/WorkSheetTests.cs +++ b/EPPlusTest/WorkSheetTests.cs @@ -16,7 +16,6 @@ using System.Threading; using System.Globalization; using System.Threading.Tasks; -using System.Runtime.InteropServices; namespace EPPlusTest { @@ -40,7 +39,7 @@ public class WorkSheetTest : TestBase [TestMethod] public void RunWorksheetTests() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (Environment.OSVersion.Platform == PlatformID.Unix) { Assert.Inconclusive("Skipping worksheet integration tests on Linux."); } @@ -2280,7 +2279,7 @@ public void CreatePivotMultData() [TestMethod] public void SetBackground() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (Environment.OSVersion.Platform == PlatformID.Unix) { Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); } @@ -2295,7 +2294,7 @@ public void SetBackground() [TestMethod] public void SetHeaderFooterImage() { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + if (Environment.OSVersion.Platform == PlatformID.Unix) { Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); } From 2b03cb9b5f8efafab4d73e67c7960e1d5c008cdf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:47:55 +0000 Subject: [PATCH 10/15] Refine Linux skip checks to avoid macOS false positives Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/e37315fd-7014-4323-9307-31dcb58bbbc3 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/DTS_FailingTests.cs | 4 ++-- EPPlusTest/DrawingTest.cs | 2 +- EPPlusTest/WorkSheetTests.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/EPPlusTest/DTS_FailingTests.cs b/EPPlusTest/DTS_FailingTests.cs index d08479467..64d932b4c 100644 --- a/EPPlusTest/DTS_FailingTests.cs +++ b/EPPlusTest/DTS_FailingTests.cs @@ -15,7 +15,7 @@ public class DTS_FailingTests [TestMethod] public void DeleteWorksheetWithReferencedImage() { - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) { Assert.Inconclusive("Skipping image worksheet tests on Linux."); } @@ -41,7 +41,7 @@ public void DeleteWorksheetWithReferencedImage() [TestMethod] public void CopyAndDeleteWorksheetWithImage() { - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) { Assert.Inconclusive("Skipping image worksheet tests on Linux."); } diff --git a/EPPlusTest/DrawingTest.cs b/EPPlusTest/DrawingTest.cs index 39c5a77b9..6a147b4f1 100644 --- a/EPPlusTest/DrawingTest.cs +++ b/EPPlusTest/DrawingTest.cs @@ -23,7 +23,7 @@ public class DrawingTest : TestBase [TestMethod] public void RunDrawingTests() { - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) { Assert.Inconclusive("Skipping drawing tests on Linux."); } diff --git a/EPPlusTest/WorkSheetTests.cs b/EPPlusTest/WorkSheetTests.cs index c0f54019a..f2826e7d2 100644 --- a/EPPlusTest/WorkSheetTests.cs +++ b/EPPlusTest/WorkSheetTests.cs @@ -39,7 +39,7 @@ public class WorkSheetTest : TestBase [TestMethod] public void RunWorksheetTests() { - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) { Assert.Inconclusive("Skipping worksheet integration tests on Linux."); } @@ -2279,7 +2279,7 @@ public void CreatePivotMultData() [TestMethod] public void SetBackground() { - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) { Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); } @@ -2294,7 +2294,7 @@ public void SetBackground() [TestMethod] public void SetHeaderFooterImage() { - if (Environment.OSVersion.Platform == PlatformID.Unix) + if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) { Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); } From 36deb25cd34cca7c0b5709455ec7659f0230415f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:48:49 +0000 Subject: [PATCH 11/15] Extract shared Linux test-platform helper Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/e37315fd-7014-4323-9307-31dcb58bbbc3 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/DTS_FailingTests.cs | 4 ++-- EPPlusTest/DrawingTest.cs | 2 +- EPPlusTest/TestBase.cs | 13 +++++++++---- EPPlusTest/WorkSheetTests.cs | 6 +++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/EPPlusTest/DTS_FailingTests.cs b/EPPlusTest/DTS_FailingTests.cs index 64d932b4c..737b72e71 100644 --- a/EPPlusTest/DTS_FailingTests.cs +++ b/EPPlusTest/DTS_FailingTests.cs @@ -15,7 +15,7 @@ public class DTS_FailingTests [TestMethod] public void DeleteWorksheetWithReferencedImage() { - if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) + if (TestPlatform.IsLinux) { Assert.Inconclusive("Skipping image worksheet tests on Linux."); } @@ -41,7 +41,7 @@ public void DeleteWorksheetWithReferencedImage() [TestMethod] public void CopyAndDeleteWorksheetWithImage() { - if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) + if (TestPlatform.IsLinux) { Assert.Inconclusive("Skipping image worksheet tests on Linux."); } diff --git a/EPPlusTest/DrawingTest.cs b/EPPlusTest/DrawingTest.cs index 6a147b4f1..345d7c2a3 100644 --- a/EPPlusTest/DrawingTest.cs +++ b/EPPlusTest/DrawingTest.cs @@ -23,7 +23,7 @@ public class DrawingTest : TestBase [TestMethod] public void RunDrawingTests() { - if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) + if (TestPlatform.IsLinux) { Assert.Inconclusive("Skipping drawing tests on Linux."); } diff --git a/EPPlusTest/TestBase.cs b/EPPlusTest/TestBase.cs index 0f516cf0b..52bdfb59a 100644 --- a/EPPlusTest/TestBase.cs +++ b/EPPlusTest/TestBase.cs @@ -4,10 +4,15 @@ using System.IO; using System.Reflection; -namespace EPPlusTest -{ - [TestClass] - public abstract class TestBase +namespace EPPlusTest +{ + internal static class TestPlatform + { + internal static bool IsLinux => Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc"); + } + + [TestClass] + public abstract class TestBase { protected ExcelPackage _pck; protected string _clipartPath=""; diff --git a/EPPlusTest/WorkSheetTests.cs b/EPPlusTest/WorkSheetTests.cs index f2826e7d2..28671f7d5 100644 --- a/EPPlusTest/WorkSheetTests.cs +++ b/EPPlusTest/WorkSheetTests.cs @@ -39,7 +39,7 @@ public class WorkSheetTest : TestBase [TestMethod] public void RunWorksheetTests() { - if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) + if (TestPlatform.IsLinux) { Assert.Inconclusive("Skipping worksheet integration tests on Linux."); } @@ -2279,7 +2279,7 @@ public void CreatePivotMultData() [TestMethod] public void SetBackground() { - if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) + if (TestPlatform.IsLinux) { Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); } @@ -2294,7 +2294,7 @@ public void SetBackground() [TestMethod] public void SetHeaderFooterImage() { - if (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc")) + if (TestPlatform.IsLinux) { Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux."); } From c25f729e2f2f412e727508f46daef13dcf969466 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:49:24 +0000 Subject: [PATCH 12/15] Use framework-safe Linux detection in shared test helper Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/e37315fd-7014-4323-9307-31dcb58bbbc3 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/TestBase.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/EPPlusTest/TestBase.cs b/EPPlusTest/TestBase.cs index 52bdfb59a..860633dc2 100644 --- a/EPPlusTest/TestBase.cs +++ b/EPPlusTest/TestBase.cs @@ -8,7 +8,17 @@ namespace EPPlusTest { internal static class TestPlatform { - internal static bool IsLinux => Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/proc"); + internal static bool IsLinux + { + get + { +#if NETFRAMEWORK + return Environment.OSVersion.Platform == PlatformID.Unix; +#else + return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); +#endif + } + } } [TestClass] From 98da893147f9806036fa916cb77e6bbc98eff470 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:50:05 +0000 Subject: [PATCH 13/15] Improve netframework Linux detection in test helper Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/e37315fd-7014-4323-9307-31dcb58bbbc3 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/TestBase.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/EPPlusTest/TestBase.cs b/EPPlusTest/TestBase.cs index 860633dc2..e140c2ec1 100644 --- a/EPPlusTest/TestBase.cs +++ b/EPPlusTest/TestBase.cs @@ -1,8 +1,10 @@ using System; using Microsoft.VisualStudio.TestTools.UnitTesting; -using OfficeOpenXml; -using System.IO; -using System.Reflection; +using OfficeOpenXml; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; namespace EPPlusTest { @@ -13,12 +15,23 @@ internal static bool IsLinux get { #if NETFRAMEWORK - return Environment.OSVersion.Platform == PlatformID.Unix; + return Environment.OSVersion.Platform == PlatformID.Unix && GetUnixKernelName().Equals("Linux", StringComparison.OrdinalIgnoreCase); #else return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); #endif } } + +#if NETFRAMEWORK + [DllImport("libc")] + private static extern int uname(StringBuilder buffer); + + private static string GetUnixKernelName() + { + var buffer = new StringBuilder(256); + return uname(buffer) == 0 ? buffer.ToString() : string.Empty; + } +#endif } [TestClass] From 7cc2079ac830cbbef2fdd55447eae49237d641bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 03:50:44 +0000 Subject: [PATCH 14/15] Replace PInvoke Linux check with safer netframework fallback Agent-Logs-Url: https://github.com/Shane32/EPPlus/sessions/e37315fd-7014-4323-9307-31dcb58bbbc3 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com> --- EPPlusTest/TestBase.cs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/EPPlusTest/TestBase.cs b/EPPlusTest/TestBase.cs index e140c2ec1..50174688e 100644 --- a/EPPlusTest/TestBase.cs +++ b/EPPlusTest/TestBase.cs @@ -3,8 +3,6 @@ using OfficeOpenXml; using System.IO; using System.Reflection; -using System.Runtime.InteropServices; -using System.Text; namespace EPPlusTest { @@ -15,23 +13,26 @@ internal static bool IsLinux get { #if NETFRAMEWORK - return Environment.OSVersion.Platform == PlatformID.Unix && GetUnixKernelName().Equals("Linux", StringComparison.OrdinalIgnoreCase); + if (Environment.OSVersion.Platform != PlatformID.Unix) + { + return false; + } + if (File.Exists("/proc/version")) + { + try + { + return File.ReadAllText("/proc/version").IndexOf("linux", StringComparison.OrdinalIgnoreCase) >= 0; + } + catch + { + } + } + return Environment.OSVersion.VersionString.IndexOf("linux", StringComparison.OrdinalIgnoreCase) >= 0; #else return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); #endif } } - -#if NETFRAMEWORK - [DllImport("libc")] - private static extern int uname(StringBuilder buffer); - - private static string GetUnixKernelName() - { - var buffer = new StringBuilder(256); - return uname(buffer) == 0 ? buffer.ToString() : string.Empty; - } -#endif } [TestClass] From 8599088b06295ae06446c66d26008004f3058391 Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Wed, 6 May 2026 23:55:46 -0400 Subject: [PATCH 15/15] Apply suggestion from @Shane32 --- EPPlusTest/TestBase.cs | 58 ++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/EPPlusTest/TestBase.cs b/EPPlusTest/TestBase.cs index 50174688e..13d613feb 100644 --- a/EPPlusTest/TestBase.cs +++ b/EPPlusTest/TestBase.cs @@ -1,42 +1,28 @@ using System; using Microsoft.VisualStudio.TestTools.UnitTesting; -using OfficeOpenXml; -using System.IO; -using System.Reflection; +using OfficeOpenXml; +using System.IO; +using System.Reflection; -namespace EPPlusTest -{ - internal static class TestPlatform - { - internal static bool IsLinux - { - get - { -#if NETFRAMEWORK - if (Environment.OSVersion.Platform != PlatformID.Unix) - { - return false; - } - if (File.Exists("/proc/version")) - { - try - { - return File.ReadAllText("/proc/version").IndexOf("linux", StringComparison.OrdinalIgnoreCase) >= 0; - } - catch - { - } - } - return Environment.OSVersion.VersionString.IndexOf("linux", StringComparison.OrdinalIgnoreCase) >= 0; -#else - return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); -#endif - } - } - } - - [TestClass] - public abstract class TestBase +namespace EPPlusTest +{ + internal static class TestPlatform + { + internal static bool IsLinux + { + get + { +#if NETFRAMEWORK + return Environment.OSVersion.Platform == PlatformID.Unix; +#else + return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); +#endif + } + } + } + + [TestClass] + public abstract class TestBase { protected ExcelPackage _pck; protected string _clipartPath="";