Skip to content

Commit 694e2ed

Browse files
Copilotpardeike
andauthored
Cleanup of CI tests
* Initial plan * Remove debugging output from GitHub Actions workflows and scripts Co-authored-by: pardeike <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: pardeike <[email protected]>
1 parent 524862d commit 694e2ed

File tree

4 files changed

+0
-109
lines changed

4 files changed

+0
-109
lines changed

.github/actions/test-execute-test/action.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ runs:
5555
"target_frameworks=$target_frameworks" | Out-File -FilePath $env:GITHUB_OUTPUT -Append;
5656
shell: pwsh
5757

58-
# Create clean TestResults directory using simple platform-specific commands
5958
- name: Clean TestResults (Windows)
6059
if: runner.os == 'Windows'
6160
run: |
@@ -121,32 +120,6 @@ runs:
121120
& $dotnet test "HarmonyTests/bin/${{inputs.build_configuration}}/$target_framework/HarmonyTests.dll" -f $target_framework --logger:"trx;LogFileName=../TestResults/$trxFileName" --logger:"console;verbosity=normal" -- ${{steps.test-args.outputs.run_settings_args}}
122121
}
123122
shell: pwsh
124-
125-
# Debug step for Windows
126-
- name: List TRX files (Windows)
127-
if: runner.os == 'Windows'
128-
run: |
129-
Write-Host "Searching for TRX files on Windows..."
130-
Write-Host "TRX files in TestResults directory:"
131-
if (Test-Path -Path "TestResults") {
132-
Get-ChildItem -Path "TestResults" -Filter "*.trx" -Recurse | ForEach-Object { Write-Host $_.FullName }
133-
} else {
134-
Write-Host "TestResults directory not found"
135-
}
136-
shell: pwsh
137-
138-
# Debug step for Unix-based systems (macOS/Linux)
139-
- name: List TRX files (Unix)
140-
if: runner.os != 'Windows'
141-
run: |
142-
echo "Searching for TRX files on Unix..."
143-
echo "TRX files in TestResults directory:"
144-
if [ -d "TestResults" ]; then
145-
find TestResults -name "*.trx" -type f | sort
146-
else
147-
echo "TestResults directory not found"
148-
fi
149-
shell: bash
150123

151124
- name: Upload Test Result
152125
uses: ./.github/actions/test-upload-result

.github/actions/test-upload-result/action.yml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,6 @@ inputs:
2424
runs:
2525
using: "composite"
2626
steps:
27-
# Use github-script to check files before upload (platform-independent)
28-
- name: Check TRX Files
29-
id: check-files
30-
uses: actions/github-script@v7
31-
with:
32-
script: |
33-
const fs = require('fs');
34-
const path = require('path');
35-
36-
try {
37-
if (!fs.existsSync('TestResults')) {
38-
console.log('TestResults directory not found');
39-
return { count: 0, files: [] };
40-
}
41-
42-
// Helper function to find all TRX files recursively
43-
function findTrxFiles(dir) {
44-
let results = [];
45-
const entries = fs.readdirSync(dir, { withFileTypes: true });
46-
47-
for (const entry of entries) {
48-
const fullPath = path.join(dir, entry.name);
49-
50-
if (entry.isDirectory()) {
51-
results = results.concat(findTrxFiles(fullPath));
52-
} else if (entry.isFile() && entry.name.endsWith('.trx')) {
53-
results.push(fullPath);
54-
}
55-
}
56-
57-
return results;
58-
}
59-
60-
const trxFiles = findTrxFiles('TestResults');
61-
console.log(`Found ${trxFiles.length} TRX files:`);
62-
trxFiles.slice(0, 10).forEach(f => console.log(f));
63-
64-
return { count: trxFiles.length, files: trxFiles.slice(0, 10) };
65-
} catch (error) {
66-
console.log(`Error checking TRX files: ${error.message}`);
67-
return { count: 0, files: [] };
68-
}
69-
7027
- name: Upload Test Results
7128
uses: actions/upload-artifact@v4
7229
if: success() || failure()

.github/workflows/test-result-upload.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,6 @@ jobs:
2626
path: test-results
2727
merge-multiple: true
2828

29-
- name: List Test Files
30-
if: always()
31-
uses: actions/github-script@v7
32-
with:
33-
script: |
34-
const fs = require('fs');
35-
const path = require('path');
36-
37-
// Count TRX files
38-
let trxCount = 0;
39-
let firstFiles = [];
40-
41-
function countTrxFiles(dir, depth = 0) {
42-
if (depth > 5) return; // Avoid infinite recursion
43-
44-
const entries = fs.readdirSync(dir, { withFileTypes: true });
45-
46-
for (const entry of entries) {
47-
const fullPath = path.join(dir, entry.name);
48-
49-
if (entry.isDirectory()) {
50-
countTrxFiles(fullPath, depth + 1);
51-
} else if (entry.isFile() && entry.name.endsWith('.trx')) {
52-
trxCount++;
53-
if (firstFiles.length < 5) {
54-
firstFiles.push(entry.name);
55-
}
56-
}
57-
}
58-
}
59-
60-
countTrxFiles('test-results');
61-
62-
console.log(`Found ${trxCount} TRX files`);
63-
if (firstFiles.length > 0) {
64-
console.log(`Sample files: ${firstFiles.join(', ')}`);
65-
}
66-
6729
- name: Publish Test Results
6830
uses: EnricoMi/publish-unit-test-result-action@v2
6931
if: always()

scripts/pack.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ New-Item -ItemType Directory -Path Lib.Harmony.Thin\bin | Out-Null
2727
dotnet clean --nologo --verbosity minimal
2828

2929
# Build Solution
30-
Write-Host "Processing configuration: $config"
3130
dotnet build --nologo --configuration Release --verbosity minimal
3231
dotnet pack --nologo --configuration Release --verbosity minimal --no-restore --no-build

0 commit comments

Comments
 (0)