c572fcfe04
Rename the Go module path from code.gitea.io/gitea to git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire codebase. Scope: - go.mod module declaration - 2,235 Go source files (import paths) - Dockerfile WORKDIR and COPY paths - Swagger API templates - golangci.yml linter config External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea, gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are separate upstream modules. Closes #132 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
945 B
Go
41 lines
945 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package attribute
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"testing"
|
|
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/git"
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/setting"
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/util"
|
|
)
|
|
|
|
func testRun(m *testing.M) error {
|
|
gitHomePath, err := os.MkdirTemp(os.TempDir(), "git-home")
|
|
if err != nil {
|
|
return fmt.Errorf("unable to create temp dir: %w", err)
|
|
}
|
|
defer util.RemoveAll(gitHomePath)
|
|
setting.Git.HomePath = gitHomePath
|
|
|
|
if err = git.InitFull(); err != nil {
|
|
return fmt.Errorf("failed to call Init: %w", err)
|
|
}
|
|
|
|
exitCode := m.Run()
|
|
if exitCode != 0 {
|
|
return fmt.Errorf("run test failed, ExitCode=%d", exitCode)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
if err := testRun(m); err != nil {
|
|
_, _ = fmt.Fprintf(os.Stderr, "Test failed: %v", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|