Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,52 @@ jobs:
- name: Build all projects
run: ./scripts/build.sh ${{ env.CI_VERSION }} Release

- name: Test
- name: Test (.NET - TRX)
run: dotnet test --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory ./TestResults

- name: Run cycodt tests
- name: Run cycodt tests (JUnit)
run: |
export PATH=$PATH:$(pwd)/src/cycod/bin/Release/net9.0:$(pwd)/src/cycodt/bin/Release/net9.0:$(pwd)/src/cycodmd/bin/Release/net9.0
which cycod
which cycodmd
which cycodt
cycodt run --log ./TestResults/test-results-cycodt.log --output-file ./TestResults/test-results-cycodt.trx
cycodt run --log ./TestResults/test-results-cycodt.log --output-file ./TestResults/test-results-cycodt.xml --output-format junit

- name: Clean up inception test TRX files
- name: Clean up inception test result files
Copy link
Owner

Choose a reason for hiding this comment

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

why not include this in previous step, as its related to previous step?

run: |
# Remove TRX files created by inception tests to avoid interference with CI reporting
rm -f tests/cycodt-yaml/inception-layer-1/*.trx
echo "Cleaned up inception test TRX files"
# Remove TRX files created by inception tests (still may exist) and any stray trx
rm -f tests/cycodt-yaml/inception-layer-1/*.trx || true
echo "Cleaned up inception test legacy TRX files"

- name: Convert TRX to JUnit XML
Copy link
Owner

Choose a reason for hiding this comment

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

This isn't required for cycodt yaml tests, yes? as we're outputing in junit directly, correct? if so, then, i'd suspect we don't need this for the TRX from dotnet test, as that doesn't seem to be the one that was having difficulty uploading, right? i'm unsure, but I'd like to check first... it's a bit non-standard to have .net tests uploaded in junit format... and, if we want that, we can probably just ask dotnet test to output in that format... and not have this step of the process....

if: always()
Copy link
Owner

Choose a reason for hiding this comment

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

doesn't always condition mean it'll actually run even if the build fails? which, wouldn't be required? why mark as always?

run: |
echo "Installing trx2junit global tool"
dotnet tool install --global trx2junit || echo "Tool already installed"
export PATH="$PATH:$HOME/.dotnet/tools"
echo "Converting TRX files to JUnit XML"
ls -1 ./TestResults/*.trx || echo "No TRX files found"
trx2junit ./TestResults/*.trx || echo "Conversion produced warnings"
echo "Post-conversion listing:"
ls -lh ./TestResults/*.xml || echo "No XML files yet"

- name: Upload test results
uses: actions/upload-artifact@v4
if: always() # Upload test results even if tests fail
if: always()
Copy link
Owner

Choose a reason for hiding this comment

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

why remove comment?

with:
name: test-results
path: |
./TestResults/*.trx
./TestResults/*.xml
./TestResults/test-results-cycodt.log
- name: Publish test results

- name: Publish JUnit results
uses: dorny/[email protected]
if: always() # Run this step even if previous steps failed
if: always()
Copy link
Owner

Choose a reason for hiding this comment

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

why remove comment?

with:
name: .NET Tests
path: ./TestResults/*.trx
reporter: dotnet-trx
name: .NET Tests (JUnit)
path: ./TestResults/*.xml
reporter: java-junit
fail-on-error: false

- name: Upload cycod build artifacts
Expand All @@ -99,6 +112,15 @@ jobs:
src/cycod/bin/Release/net9.0/linux-x64/publish/
src/cycod/bin/Release/net9.0/osx-x64/publish/

- name: Publish .NET TRX results
Copy link
Owner

Choose a reason for hiding this comment

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

and then, we also publish the .net TRX results for the dotnet test based tests? i'm a bit confused then, why we need to convert any TRX files to junit xml above...

uses: dorny/[email protected]
if: always()
with:
name: .NET Tests (TRX)
path: ./TestResults/*.trx
reporter: dotnet-trx
fail-on-error: false

- name: Upload cycodt build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions tests/cycod/Helpers/DirectoryHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public void Setup()
_testRootPath = Path.Combine(Path.GetTempPath(), $"DirectoryHelpersTests_{Guid.NewGuid()}");
Directory.CreateDirectory(_testRootPath!);
Directory.SetCurrentDirectory(_testRootPath!);
// Normalize path to the canonical resolved form to avoid /var vs /private/var differences on macOS
_testRootPath = Directory.GetCurrentDirectory();

}

[TestCleanup]
Expand Down