Skip to content

Commit 81a21ce

Browse files
cleanup and unit test automation
1 parent e1e721f commit 81a21ce

26 files changed

+138
-13976
lines changed

.fossa.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# FOSSA Configuration for SharpGraph Project
2+
3+
version: 3
4+
5+
cli:
6+
allow-unresolved: false
7+
suppress-errors: false
8+
9+
project:
10+
name: SharpGraph
11+
description: "GraphQL filtering and query optimization library for .NET"
12+
13+
exclude:
14+
directories:
15+
- bin
16+
- obj
17+
- node_modules
18+
- .vs
19+
- .vscode
20+
- .git
21+
- build
22+
- dist
23+
extensions:
24+
- .git
25+
- .gitignore
26+
- .gitattributes
27+
28+
# Analyze dependencies from all project files
29+
analyze:
30+
# .NET projects
31+
- type: dotnet
32+
paths:
33+
- ./src/SharpGraph.Core/SharpGraph.Core.csproj
34+
- ./src/SharpGraph.Server/SharpGraph.Server.csproj
35+
- ./src/SharpGraph.Ide/SharpGraph.Ide.csproj
36+
- ./src/SharpGraph.Benchmark/SharpGraph.Benchmark.csproj
37+
- ./tests/SharpGraph.Tests/SharpGraph.Tests.csproj
38+
- ./examples/SharpGraph.Example/SharpGraph.Example.csproj
39+
- ./examples/StarWars/StarWars.csproj

.github/workflows/unit-tests.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
test:
15+
name: Run Unit Tests
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: '8.0.x'
25+
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build --configuration Release --no-restore
31+
32+
- name: Run Tests
33+
run: dotnet test tests/SharpGraph.Tests/SharpGraph.Tests.csproj --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --logger "console;verbosity=detailed"
34+
35+
- name: Generate Test Report
36+
if: always()
37+
run: |
38+
$trxFile = Get-ChildItem -Path . -Filter "test-results.trx" -Recurse | Select-Object -First 1
39+
if ($null -ne $trxFile) {
40+
[xml]$trx = Get-Content $trxFile.FullName
41+
$passed = $trx.TestRun.ResultSummary.Counters.passed
42+
$failed = $trx.TestRun.ResultSummary.Counters.failed
43+
$total = $trx.TestRun.ResultSummary.Counters.total
44+
$duration = $trx.TestRun.Times.duration
45+
46+
$report = @"
47+
# Unit Test Report
48+
49+
**Run Date**: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss UTC')
50+
**Branch**: ${{ github.ref_name }}
51+
**Commit**: ${{ github.sha }}
52+
53+
## Summary
54+
55+
| Metric | Count |
56+
|--------|-------|
57+
| Total Tests | $total |
58+
| ✅ Passed | $passed |
59+
| ❌ Failed | $failed |
60+
| Duration | $duration |
61+
62+
## Test Categories
63+
64+
- Lexer Tests
65+
- Filtering Tests
66+
- Storage Tests
67+
- Index Tests (BTree, Hash)
68+
- Mutation Tests
69+
- Parsing Tests
70+
71+
## Status
72+
73+
$( if ($failed -eq 0) { "✅ **All tests passing**" } else { "❌ **Tests failed**" } )
74+
75+
---
76+
77+
[View Full Test Results](../actions/runs/${{ github.run_id }})
78+
"@
79+
80+
$report | Out-File -FilePath "test-report.md" -Encoding UTF8
81+
Write-Host $report
82+
}
83+
84+
- name: Upload Test Results
85+
uses: actions/upload-artifact@v4
86+
if: always()
87+
with:
88+
name: test-results
89+
path: '**/test-results.trx'
90+
retention-days: 30
91+
92+
- name: Upload Test Report
93+
uses: actions/upload-artifact@v4
94+
if: always()
95+
with:
96+
name: test-report
97+
path: test-report.md
98+
retention-days: 30

FILTERING_COMPLETE.md

Lines changed: 0 additions & 223 deletions
This file was deleted.

0 commit comments

Comments
 (0)