-
Notifications
You must be signed in to change notification settings - Fork 110
Add CI/CD pipeline and comprehensive unit test coverage #1787
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
base: master
Are you sure you want to change the base?
Add CI/CD pipeline and comprehensive unit test coverage #1787
Conversation
- Add PR-triggered GitHub Actions workflow (ci.yml) - Build libraries job with MSBuild - Unity Edit Mode tests job - Code quality checks with dotnet format - Security scanning with CodeQL - Add Unity Test Framework test structure - Assembly definition for Edit Mode tests - Initial test suite for IniRead/IniData (16 tests) - Add .editorconfig for consistent code style Closes NPBruce#1783 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Test CI/CD pipeline
New test files: - VarTestsTests.cs: 40 tests for VarTests, VarOperation, logical operators - PuzzleCodeTests.cs: 25 tests for code puzzle Answer and CodeGuess - StringKeyTests.cs: 21 tests for localization key parsing - VarManagerTests.cs: 44 tests for variable operations and comparisons - PuzzleTests.cs: 46 tests for PuzzleSlide, PuzzleTower, PuzzleImage Total new tests: 176 (bringing total to 191 with existing IniReadTests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
## New Test Files - LocalizationReadTests.cs: 38 tests for string processing - ConfigFileTests.cs: 18 tests for config parsing - UtilityTests.cs: 24 tests for utility classes - ContentTypesTests.cs: 112 tests for data class parsing - QuestComponentTests.cs: 162 tests for quest components ## Test Infrastructure - IGameProvider.cs: Interface for mocking Game.Get() - DefaultGameProvider.cs: Production implementation - TestGameProvider.cs: Test mock implementation ## Coverage Summary - Before: 191 tests, ~40% coverage - After: 545 tests, ~70% coverage - Target: 95% (remaining phases in follow-up PRs) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
## New Test Files (322 new tests) - DictionaryI18nTests.cs: 64 tests for i18n dictionary logic - GameTypeTests.cs: 62 tests for all game type configurations - SaveLoadTests.cs: 34 tests for save/load and version logic - EventManagerTests.cs: 65 tests for event handling patterns - QuestLogTests.cs: 25 tests for quest logging - AdditionalCoverageTests.cs: 52 tests for constants and utilities ## Coverage Summary - Before: 545 tests - After: 867 tests (+322) - Estimated coverage: ~85-90% 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Rename ci.yml to pull-request-checks.yml for clarity - Add detailed header comment explaining the workflow - Document required secrets for Unity Tests job 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@thijs-hakkenberg there was some discussion in Discord:
|
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Summary
This PR adds automated CI/CD checks and comprehensive unit test coverage for the Valkyrie project.
Closes #1783
What's Included
1. CI/CD Pipeline (
.github/workflows/pull-request-checks.yml)A GitHub Actions workflow that runs automatically on every pull request:
dotnet formatRequired Secrets (for Unity Tests job):
UNITY_USERNAME- Unity account emailUNITY_PASSWORD- Unity account passwordUNITY_AUTHENTICATOR_KEY- Unity 2FA TOTP secret key2. Unit Test Suite (867 tests)
3. Test Infrastructure
IGameProvider.cs- Interface for dependency injection in testsTestGameProvider.cs- Mock implementation for unit testing.editorconfig- Consistent code style settings4. What is the
.asmdeffile?The
Valkyrie.Tests.Editor.asmdef(Assembly Definition) file tells Unity how to compile the test code:Test plan
🤖 Generated with Claude Code