Fix data-race during testing (#30999)
Fix #30992
(cherry picked from commit 47accfebbd69e5f47d1b97a3e39cf181fab7e597)
Conflicts:
models/unit/unit.go
trivial context conflict because of
e07b0e75ff
Add a direct link from repo header to unit settings
This commit is contained in:
parent
a649610d61
commit
f6e50abd65
3 changed files with 36 additions and 20 deletions
|
@ -9,13 +9,15 @@ import (
|
|||
"testing"
|
||||
|
||||
unit_model "code.gitea.io/gitea/models/unit"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
"code.gitea.io/gitea/tests"
|
||||
)
|
||||
|
||||
func TestOrgProjectAccess(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
defer test.MockVariableValue(&unit_model.DisabledRepoUnits, append(slices.Clone(unit_model.DisabledRepoUnits), unit_model.TypeProjects))()
|
||||
|
||||
disabledRepoUnits := unit_model.DisabledRepoUnitsGet()
|
||||
unit_model.DisabledRepoUnitsSet(append(slices.Clone(disabledRepoUnits), unit_model.TypeProjects))
|
||||
defer unit_model.DisabledRepoUnitsSet(disabledRepoUnits)
|
||||
|
||||
// repo project, 404
|
||||
req := NewRequest(t, "GET", "/user2/repo1/projects")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue