-
Notifications
You must be signed in to change notification settings - Fork 13
development: run dotnet unit tests #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a GitHub Actions workflow to automatically restore, build, and run .NET unit tests on Ubuntu for .NET 8.0 upon pushes and pull requests targeting the main branch.
- Introduces
.github/workflows/dotnet-tests.ymldefining the CI job - Configures triggers on
pushandpull_requestformain - Uses standard
dotnet restore,build, andtestcommands
Comments suppressed due to low confidence (1)
.github/workflows/dotnet-tests.yml:1
- [nitpick] The workflow filename (
dotnet-tests.yml) and the workflowname(dotnet_unit_tests) differ from the PR title (dotnet_unit_tests.yml). Consider aligning the file name, workflow name, and documentation for consistency.
name: dotnet_unit_tests
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup .NET |
Copilot
AI
Jun 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To speed up CI runs, consider adding a caching step for NuGet packages (e.g., using actions/cache@v3) before dotnet restore.
| { | ||
| const string BasePath = "DemoData"; | ||
| const string Deployment = "DemoDeployment"; | ||
| const string Database = "DemoDatabase"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this Database string collides with the Model.Database type.
| public async Task GetDatabase() | ||
| { | ||
| var factory = new YamlDatabaseHandlerFactory() | ||
| var factory = new YamlDatabaseHandlerFactory<Model.Database>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required by the move from net6 to net8
| // Assert.Equal("120d", db.Tables["tableWithUp"].RetentionAndCachePolicy.Retention); | ||
| // Assert.Equal("120d", db.Tables["sourceTable"].RetentionAndCachePolicy.HotCache); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests appear to be obsolete and now throw nullptr exceptions.
The fix for this is addressed in #99
just commenting out for now.
I do not have permissions to run this, but it looks approximately correct.
Add .NET Unit Tests GitHub Workflow
Summary
This PR adds a GitHub Actions workflow that automatically runs unit tests for the KustoSchemaTools project on every push to main and on every pull request. This will help catch issues earlier in the development process and ensure code quality.
Changes
.github/workflows/dotnet_unit_tests.ymlworkflow fileHow to Set Up as a Required Check
After merging this PR, follow these steps to make this workflow a required check for PRs:
This will ensure that all PRs must pass the unit tests before they can be merged, which will help maintain code quality and prevent regressions.
Testing Done
dotnet test