Skip to content

Commit da449ee

Browse files
committed
chore(qqqq): tidy files not in vs and add a little test run script
1 parent 410b1ae commit da449ee

File tree

5 files changed

+56
-3
lines changed

5 files changed

+56
-3
lines changed

.github/workflows/workflow-readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ The individual steps also automatically pass so can see if any error at the end
8383
- for tests use the run-tests-and-report-with-env-values.ps1 file
8484

8585
## Versioning
86-
86+
Via semantic release and recorded as a generate c# file used by a blazor component

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ It is recommended you check setup by reading this section and making sure packag
173173
- **packagesettings.props** sets thresholds
174174
- running at solution level **./run-tests-and-report-with-env-values.ps1** (see in the file for specific arguments you may want to set)
175175
- will produce a test coverage site **[your repo folder]/TELBlazor/CoverageReport/index.html**
176-
176+
- then look at CoverageReport in solution root and you can bookmark index.html to see your coverage
177+
- E2E project has a Reports folder for tracings
178+
- Similarly run-tests-and-report-using-local-props.ps1 runs just using your local props file
179+
- appsettings.Development can be set in the E2E Host to log to the Logs folder at project route, see template
177180

178181

179182
#### Tips
@@ -186,7 +189,7 @@ It is recommended you check setup by reading this section and making sure packag
186189
```
187190
npm install -g @commitlint/cli @commitlint/config-angular
188191
```
189-
- You can put into your pre-push, pre-commit hook, or into the gitguardian hooks some logic like the below.
192+
- You can put into your pre-push, pre-commit hook, commit-ms, or into the gitguardian hooks some logic like the below.
190193
```
191194
#### --- Commitlint Logic (force local config) ---
192195
REPO_ROOT=$(git rev-parse --show-toplevel)
@@ -270,6 +273,7 @@ It is recommended you check setup by reading this section and making sure packag
270273
- if still not working delete **bin** and **obj**
271274
- if still not working, restart Visual Studio
272275
- if there are still issues its easier to problem solve by using a random very high **TELBlazor.Components** package version number and ensuring it fails and says it found the source but not the version
276+
273277
#### Git commit names
274278
- git commit names can be caught locally
275279
- if they are not
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gitinclude

TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/appsettings.Development.json.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"Name": "File",
3636
"Args": {
3737
"path": "Logs/log-development2-.txt",
38+
// Adjust the path as needed for your environment because currently its relative to bin e.g. "path": "C:/dev/repos/TELBlazor/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/Logs/log-development2-.txt",
3839
"rollingInterval": "Day",
3940
"rollOnFileSizeLimit": true,
4041
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<#
2+
.SYNOPSIS
3+
Run tests and generate coverage report using local MSBuild props file for environment settings.
4+
5+
6+
.USAGE
7+
From the solution root (where this script lives), run:
8+
./run-tests-and-report-using-local-props.ps1
9+
#>
10+
11+
# Go to script root
12+
$ScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
13+
Set-Location $ScriptRoot
14+
15+
# Path to your local props file
16+
$LocalPropsFile = Join-Path $ScriptRoot "PackageSettings.props.local"
17+
18+
if (-Not (Test-Path $LocalPropsFile)) {
19+
Write-Error "Local props file not found at $LocalPropsFile"
20+
exit 1
21+
}
22+
23+
# Load MSBuild XML
24+
[xml]$propsXml = Get-Content $LocalPropsFile
25+
26+
# Extract values and set env variables
27+
$env:TELBLAZOR_PACKAGE_VERSION = $propsXml.Project.PropertyGroup.TELBlazorPackageVersion
28+
$env:NUGET_PACKAGES_OUTPUT_PATH = $propsXml.Project.PropertyGroup.NugetPackagesOutputPath
29+
$env:USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE = $propsXml.Project.PropertyGroup.UseTELBlazorComponentsProjectReference
30+
$env:DISABLE_PACKAGE_GENERATION = $propsXml.Project.PropertyGroup.DisablePackageGeneration
31+
32+
Write-Host "Using the following local settings from PackageSettings.Local.props:"
33+
Write-Host "TELBLAZOR_PACKAGE_VERSION=$env:TELBLAZOR_PACKAGE_VERSION"
34+
Write-Host "NUGET_PACKAGES_OUTPUT_PATH=$env:NUGET_PACKAGES_OUTPUT_PATH"
35+
Write-Host "USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE=$env:USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE"
36+
Write-Host "DISABLE_PACKAGE_GENERATION=$env:DISABLE_PACKAGE_GENERATION"
37+
38+
# Run Tests
39+
dotnet test --no-build --no-restore --settings .runsettings
40+
41+
# Generate Coverage Report
42+
dotnet reportgenerator `
43+
-reports:"**/AllTestResults/**/coverage.cobertura.xml" `
44+
-targetdir:CoverageReport `
45+
-reporttypes:Html
46+
47+
Write-Host "Coverage report generated at: $ScriptRoot\CoverageReport\index.html"

0 commit comments

Comments
 (0)