1616
1717Aruba . configure do |config |
1818 # Increase the default timeout from 3 seconds to 15 seconds.
19- # This covers standard commands that are just slightly slow.
2019 config . exit_timeout = 15
2120
2221 # Optional: Increase I/O wait time if your tool is slow to output text
2625# configure aruba for rspec use
2726RSpec . configure do |config |
2827 config . include Aruba ::Api
29- # If running in a CI environment, use the verbose 'documentation'
30- # formatter so we see progress line-by-line.
28+ # If running in a CI environment, use the verbose 'documentation' formatter
3129 config . formatter = :documentation if ENV [ "CI" ]
3230
33- # We use aruba's helper to prepend the bin path safely for each test.
3431 config . before ( :each ) do
35- # 1. Configure Git identity for Unit Tests (running in this Ruby process)
36- ENV [ "GIT_AUTHOR_NAME" ] = "Tetra Test"
37- ENV [ "GIT_AUTHOR_EMAIL" ] = "test@example.com"
38- ENV [ "GIT_COMMITTER_NAME" ] = "Tetra Test"
39- ENV [ "GIT_COMMITTER_EMAIL" ] = "test@example.com"
40-
41- # 2. Configure Git identity for aruba and CI tests (running in subprocesses)
32+ # Configure Git identity for Aruba (subprocesses only)
4233 if respond_to? ( :set_environment_variable )
4334 set_environment_variable ( "GIT_AUTHOR_NAME" , "Tetra Test" )
4435 set_environment_variable ( "GIT_AUTHOR_EMAIL" , "test@example.com" )
4536 set_environment_variable ( "GIT_COMMITTER_NAME" , "Tetra Test" )
4637 set_environment_variable ( "GIT_COMMITTER_EMAIL" , "test@example.com" )
4738 end
4839
49- # 3. Existing PATH setup
50- bin_path = File . expand_path ( File . join ( __dir__ , ".." , "bin" ) )
51- prepend_environment_variable ( "PATH" , bin_path + File ::PATH_SEPARATOR ) if respond_to? ( :prepend_environment_variable )
52-
40+ # 2. Add bin path to environment
5341 bin_path = File . expand_path ( File . join ( __dir__ , ".." , "bin" ) )
5442 prepend_environment_variable ( "PATH" , bin_path + File ::PATH_SEPARATOR )
5543 end
@@ -62,6 +50,15 @@ module Mockers
6250 def create_mock_project
6351 @project_path = File . join ( "spec" , "data" , "test-project" )
6452 Tetra ::Project . init ( @project_path , false )
53+
54+ # FIX: Configure git locally for this specific test repository.
55+ # This ensures unit tests are deterministic and pass on CI without
56+ # overriding the user's global git config in the process environment.
57+ Dir . chdir ( @project_path ) do
58+ system ( "git config user.email 'test@example.com'" )
59+ system ( "git config user.name 'Tetra Test'" )
60+ end
61+
6562 @project = Tetra ::Project . new ( @project_path )
6663 end
6764
0 commit comments