- Massive replacement of changing `code.gitea.io/gitea` to `forgejo.org`. - Resolves forgejo/discussions#258 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7337 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			828 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			828 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2024 The Gitea Authors. All rights reserved.
 | |
| // SPDX-License-Identifier: MIT
 | |
| 
 | |
| package actions
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	actions_model "forgejo.org/models/actions"
 | |
| 	"forgejo.org/models/unittest"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| 	"github.com/stretchr/testify/require"
 | |
| )
 | |
| 
 | |
| func TestFindTaskNeeds(t *testing.T) {
 | |
| 	require.NoError(t, unittest.PrepareTestDatabase())
 | |
| 
 | |
| 	task := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionTask{ID: 51})
 | |
| 	job := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRunJob{ID: task.JobID})
 | |
| 
 | |
| 	ret, err := FindTaskNeeds(t.Context(), job)
 | |
| 	require.NoError(t, err)
 | |
| 	assert.Len(t, ret, 1)
 | |
| 	assert.Contains(t, ret, "job1")
 | |
| 	assert.Len(t, ret["job1"].Outputs, 2)
 | |
| 	assert.Equal(t, "abc", ret["job1"].Outputs["output_a"])
 | |
| 	assert.Equal(t, "bbb", ret["job1"].Outputs["output_b"])
 | |
| }
 |