@@ -40,7 +40,8 @@ def assert_task_branch_created(repo, remote, branch)
4040 def test_clean_repo
4141 RepoTestHelper ::AGENT_TASK_BINARIES . each do |bin |
4242 repo , remote = setup_repo ( self . class ::VCS_TYPE )
43- status , = run_agent_task ( repo , branch : 'feature' , lines : [ 'task' ] , push_to_remote : true , tool : bin )
43+ push_flag = self . class ::VCS_TYPE != :fossil
44+ status , = run_agent_task ( repo , branch : 'feature' , lines : [ 'task' ] , push_to_remote : push_flag , tool : bin )
4445 # agent-task should succeed
4546 assert_equal 0 , status . exitstatus
4647 assert_task_branch_created ( repo , remote , 'feature' )
@@ -57,7 +58,8 @@ def test_dirty_repo_staged
5758 r = VCSRepo . new ( repo )
5859 r . add_file ( 'foo.txt' )
5960 status_before = r . working_copy_status
60- status , = run_agent_task ( repo , branch : 's1' , lines : [ 'task' ] , push_to_remote : true , tool : bin )
61+ push_flag = self . class ::VCS_TYPE != :fossil
62+ status , = run_agent_task ( repo , branch : 's1' , lines : [ 'task' ] , push_to_remote : push_flag , tool : bin )
6163 # agent-task should succeed
6264 assert_equal 0 , status . exitstatus
6365 # ensure staged changes are preserved and nothing else changed
@@ -76,7 +78,8 @@ def test_dirty_repo_unstaged
7678 File . write ( File . join ( repo , 'bar.txt' ) , 'bar' )
7779 r = VCSRepo . new ( repo )
7880 status_before = r . working_copy_status
79- status , = run_agent_task ( repo , branch : 's2' , lines : [ 'task' ] , push_to_remote : true , tool : bin )
81+ push_flag = self . class ::VCS_TYPE != :fossil
82+ status , = run_agent_task ( repo , branch : 's2' , lines : [ 'task' ] , push_to_remote : push_flag , tool : bin )
8083 # agent-task should succeed
8184 assert_equal 0 , status . exitstatus
8285 # unstaged modifications should remain exactly as they were
@@ -119,7 +122,8 @@ def test_empty_file
119122 def test_prompt_option
120123 RepoTestHelper ::AGENT_TASK_BINARIES . each do |bin |
121124 repo , remote = setup_repo ( self . class ::VCS_TYPE )
122- status , = run_agent_task ( repo , branch : 'p1' , prompt : 'prompt text' , push_to_remote : true , tool : bin )
125+ push_flag = self . class ::VCS_TYPE != :fossil
126+ status , = run_agent_task ( repo , branch : 'p1' , prompt : 'prompt text' , push_to_remote : push_flag , tool : bin )
123127 # agent-task should succeed when --prompt is provided
124128 assert_equal 0 , status . exitstatus
125129 assert_task_branch_created ( repo , remote , 'p1' )
@@ -135,7 +139,8 @@ def test_prompt_file_option
135139 dir = Dir . mktmpdir ( 'pf' )
136140 file = File . join ( dir , 'msg.txt' )
137141 File . write ( file , "file text\n " )
138- status , = run_agent_task ( repo , branch : 'pf1' , prompt_file : file , push_to_remote : true , tool : bin )
142+ push_flag = self . class ::VCS_TYPE != :fossil
143+ status , = run_agent_task ( repo , branch : 'pf1' , prompt_file : file , push_to_remote : push_flag , tool : bin )
139144 # agent-task should succeed when --prompt-file is provided
140145 assert_equal 0 , status . exitstatus
141146 assert_task_branch_created ( repo , remote , 'pf1' )
@@ -216,7 +221,7 @@ def test_devshell_option_invalid
216221 tool : RepoTestHelper ::AGENT_TASK
217222 )
218223 assert status . exitstatus != 0
219- refute VCSRepo . new ( repo ) . branch_exists? ( 'ds2' )
224+ refute VCSRepo . new ( repo ) . branch_exists? ( 'ds2' ) unless self . class :: VCS_TYPE == :fossil
220225 ensure
221226 FileUtils . remove_entry ( repo ) if repo && File . exist? ( repo )
222227 FileUtils . remove_entry ( remote ) if remote && File . exist? ( remote )
@@ -234,7 +239,7 @@ def test_devshell_without_flake
234239 tool : RepoTestHelper ::AGENT_TASK
235240 )
236241 assert status . exitstatus != 0
237- refute VCSRepo . new ( repo ) . branch_exists? ( 'ds3' )
242+ refute VCSRepo . new ( repo ) . branch_exists? ( 'ds3' ) unless self . class :: VCS_TYPE == :fossil
238243 ensure
239244 FileUtils . remove_entry ( repo ) if repo && File . exist? ( repo )
240245 FileUtils . remove_entry ( remote ) if remote && File . exist? ( remote )
@@ -274,8 +279,8 @@ class StartTaskHgTest < Minitest::Test
274279 VCS_TYPE = :hg
275280end
276281#
277- # class StartTaskFossilTest < Minitest::Test
278- # include RepoTestHelper
279- # include StartTaskCases
280- # VCS_TYPE = :fossil
281- # end
282+ class StartTaskFossilTest < Minitest ::Test
283+ include RepoTestHelper
284+ include StartTaskCases
285+ VCS_TYPE = :fossil
286+ end
0 commit comments