-
Notifications
You must be signed in to change notification settings - Fork 13
Git Integration Tests
Git branch tracking functionality including branch detection, session management per branch, and git repository monitoring.
Objective: Verify that current git branch is detected correctly
Prerequisites: Extension installed, workspace is a git repository
Priority: High | Category: Branch Detection
Steps:
- Open VS Code in a git repository
- Check current branch using
git branch
- Start tracking activity
- Verify extension detects correct branch name
- Check status bar or logs for branch information
Expected Result:
- Extension correctly identifies current git branch
- Branch name is displayed/logged accurately
- Works with any valid git branch name
Objective: Verify that branch changes are detected and sessions are managed correctly
Prerequisites: Extension installed, git repository with multiple branches
Priority: High | Category: Branch Management
Steps:
- Start tracking on branch A
- Work for several minutes
- Switch to branch B using
git checkout branch-B
- Continue working
- Verify session saved for branch A and new session started for branch B
Expected Result:
- Current session saved when branch changes
- New session starts automatically on new branch
- Branch change is logged with proper timestamps
- No time loss during branch switch
Objective: Verify handling of multiple rapid branch switches
Prerequisites: Extension installed, git repository with 3+ branches
Priority: High | Category: Branch Management
Steps:
- Start tracking on branch A
- Work for 2 minutes
- Switch to branch B, work for 2 minutes
- Switch to branch C, work for 2 minutes
- Switch back to branch A
- Verify all sessions are tracked separately
Expected Result:
- Each branch maintains separate time tracking
- Sessions are saved correctly for each branch
- Total time is accurate across all branches
- No session data mixing between branches
Objective: Verify extension works correctly in non-git workspaces
Prerequisites: Extension installed, workspace without git initialization
Priority: Medium | Category: Non-Git Support
Steps:
- Open VS Code in a folder without .git directory
- Start tracking activity
- Verify extension functionality
- Check that branch is marked as 'unknown' or similar
Expected Result:
- Extension works normally without git repository
- Branch field shows appropriate default value
- No errors or crashes related to missing git
- Time tracking functions normally
Objective: Verify behavior when git is initialized in existing workspace
Prerequisites: Extension installed, non-git workspace open
Priority: Low | Category: Git Initialization
Steps:
- Start tracking in non-git workspace
- Initialize git repository (
git init
) - Create and checkout a branch
- Continue tracking
- Verify extension adapts to new git repository
Expected Result:
- Extension detects git initialization
- Branch tracking starts working automatically
- Previous session data remains intact
- New sessions include branch information
Objective: Verify handling of branch creation and deletion operations
Prerequisites: Extension installed, git repository
Priority: Medium | Category: Branch Lifecycle
Steps:
- Start tracking on main branch
- Create new branch and switch to it
- Work on new branch
- Switch back to main
- Delete the created branch
- Verify session data integrity
Expected Result:
- New branch creation detected correctly
- Sessions tracked separately for new branch
- Branch deletion doesn't affect stored session data
- Historical data remains accessible
Objective: Verify git monitoring doesn't impact VS Code performance
Prerequisites: Extension installed, git repository with many branches
Priority: Medium | Category: Performance
Steps:
- Open large git repository
- Start tracking activity
- Monitor CPU usage and memory
- Perform normal development activities
- Check for performance issues
Expected Result:
- Git monitoring has minimal performance impact
- No noticeable lag in VS Code
- Memory usage remains stable
- Branch checking interval is reasonable (5 seconds)
Objective: Verify extension handles concurrent git operations correctly
Prerequisites: Extension installed, git repository
Priority: Medium | Category: Concurrency
Steps:
- Start tracking activity
- Perform git operations from command line while tracking
- Use VS Code git features simultaneously
- Switch branches using different methods
- Verify branch detection remains accurate
Expected Result:
- Extension correctly detects external git operations
- No conflicts with VS Code built-in git features
- Branch changes detected regardless of method used
- Locking mechanism prevents concurrent issues
Objective: Verify graceful handling of git repository issues
Prerequisites: Extension installed, ability to simulate git issues
Priority: Low | Category: Error Handling
Steps:
- Start tracking in working git repository
- Simulate git repository corruption or issues
- Verify extension behavior
- Restore git repository
- Check that tracking resumes normally
Expected Result:
- Extension handles git errors gracefully
- No crashes or unhandled exceptions
- Fallback to 'unknown' branch when git fails
- Automatic recovery when git issues resolved
Objective: Verify handling of unusual branch names
Prerequisites: Extension installed, git repository
Priority: Low | Category: Edge Cases
Steps:
- Create branches with special characters in names
- Create branches with very long names
- Create branches with spaces or unusual characters
- Switch between these branches while tracking
- Verify all branch names are handled correctly
Expected Result:
- All valid git branch names are supported
- Special characters don't cause issues
- Long branch names are handled appropriately
- No encoding or display issues
Objective: Verify behavior in git detached HEAD state
Prerequisites: Extension installed, git repository
Priority: Low | Category: Git States
Steps:
- Start tracking on normal branch
- Checkout a specific commit (detached HEAD)
- Continue tracking activity
- Switch back to normal branch
- Verify session management
Expected Result:
- Detached HEAD state is detected and handled
- Sessions are managed appropriately
- Branch field shows appropriate indicator for detached state
- Normal operation resumes when returning to branch
Objective: Verify tracking works correctly with git submodules
Prerequisites: Extension installed, git repository with submodules
Priority: Low | Category: Submodules
Steps:
- Open workspace with git submodules
- Work in main repository
- Work in submodule directories
- Switch branches in main repo and submodules
- Verify tracking behavior
Expected Result:
- Main repository and submodules tracked appropriately
- Branch detection works for submodules
- Sessions managed correctly across repository boundaries
- No confusion between main repo and submodule branches
- Git installed and configured
- VS Code with git support enabled
- Test repositories with diverse branch structures
- Command line access for git operations
- Git repository with multiple branches
- Branches with various naming patterns
- Large repository for performance testing
- Repository with submodules (optional)
# Create test repository
git init test-repo
cd test-repo
# Create multiple branches
git checkout -b main
git checkout -b feature/user-authentication
git checkout -b feature/data-export
git checkout -b hotfix/critical-bug
git checkout -b develop
# Create branch with special characters
git checkout -b "feature/special-chars_123"
# Create files for testing
echo "console.log('main');" > main.js
git add . && git commit -m "Initial commit"
- Monitor CPU usage during git operations
- Track memory consumption with many branches
- Verify git check interval (5 seconds) is respected
- Ensure no excessive git process spawning
Related Tests: Core Features Tests | Database Tests | Test Case Index