mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 07:21:36 +01:00 
			
		
		
		
	Fix job status aggregation logic (#35000)
For a run (assume 2 jobs) that has a failed job and a waiting job, the run status should be waiting, **as the run is not done yet.** Related #34823
This commit is contained in:
		
							parent
							
								
									8ee96039aa
								
							
						
					
					
						commit
						39f145ae72
					
				| @ -187,10 +187,10 @@ func AggregateJobStatus(jobs []*ActionRunJob) Status { | ||||
| 		return StatusCancelled | ||||
| 	case hasRunning: | ||||
| 		return StatusRunning | ||||
| 	case hasFailure: | ||||
| 		return StatusFailure | ||||
| 	case hasWaiting: | ||||
| 		return StatusWaiting | ||||
| 	case hasFailure: | ||||
| 		return StatusFailure | ||||
| 	case hasBlocked: | ||||
| 		return StatusBlocked | ||||
| 	default: | ||||
|  | ||||
| @ -64,7 +64,7 @@ func TestAggregateJobStatus(t *testing.T) { | ||||
| 		{[]Status{StatusFailure, StatusSuccess}, StatusFailure}, | ||||
| 		{[]Status{StatusFailure, StatusSkipped}, StatusFailure}, | ||||
| 		{[]Status{StatusFailure, StatusCancelled}, StatusCancelled}, | ||||
| 		{[]Status{StatusFailure, StatusWaiting}, StatusFailure}, | ||||
| 		{[]Status{StatusFailure, StatusWaiting}, StatusWaiting}, | ||||
| 		{[]Status{StatusFailure, StatusRunning}, StatusRunning}, | ||||
| 		{[]Status{StatusFailure, StatusBlocked}, StatusFailure}, | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user