Skip to content

Conversation

@SkowronskiAndrew
Copy link
Collaborator

@SkowronskiAndrew SkowronskiAndrew commented Dec 12, 2025

Summary

This PR fixes failing tests in the UnityDataTool.Tests project and adds a GitHub Actions workflow to run tests
automatically on commits and pull requests.

The tests weren't being run automatically and recent PRs broke UnityDataTools in a case that was actually detected by existing tests.

Changes

1. Bug Fix: Duplicate SQL Schema Creation

File: Analyzer/Resources/AssetBundle.sql

Problem: The test Analyze_PlayerData_DatabaseCorrect was failing with:
SQLite Error 1: 'view asset_view already exists'

Root Cause: Both AssetBundleHandler and AddAssetDependency command were executing the same SQL schema from
Resources.AssetBundle, causing views to be created twice. While tables used CREATE TABLE IF NOT EXISTS
(idempotent), views used plain CREATE VIEW which failed on the second execution.

Fix: Changed view creation to use CREATE VIEW IF NOT EXISTS for:

  • asset_view (line 11)
  • asset_dependencies_view (line 17)

This makes the SQL schema idempotent and safe to execute multiple times.

Test Results: All 116 tests in UnityDataTool.Tests now pass ✅

2. GitHub Actions Test Workflow

File: .github/workflows/test.yml

Added automated testing that:

  • Runs on push to main and on pull requests
  • Tests on the same OS/architecture matrix as the build workflow:
    • Windows x64
    • macOS arm64

3. Documentation

Added initial documentation for AI assistants working in this codebase (as generated by CLAUDE.md).

This is also useful for humans.

Testing

Verified locally on Windows x64

And new GitHub action ran and both platforms passed.

asset_view could be created multiple times when looking at player data.
@SkowronskiAndrew SkowronskiAndrew merged commit 8f6eee2 into main Dec 12, 2025
5 checks passed
@SkowronskiAndrew SkowronskiAndrew deleted the fix-automated-tests branch December 18, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants