mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-24 10:46:10 +01:00
Fix stray directories generated by integration tests (#1134)
This commit is contained in:
parent
fa41ddd3eb
commit
288226e13c
|
@ -9,7 +9,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -21,19 +20,19 @@ const ServerHTTPPort = "3001"
|
||||||
|
|
||||||
const _RetryLimit = 10
|
const _RetryLimit = 10
|
||||||
|
|
||||||
func makeSimpleSettings(user, workdir, port string) map[string][]string {
|
func makeSimpleSettings(user, port string) map[string][]string {
|
||||||
return map[string][]string{
|
return map[string][]string{
|
||||||
"db_type": {"SQLite3"},
|
"db_type": {"SQLite3"},
|
||||||
"db_host": {"localhost"},
|
"db_host": {"localhost"},
|
||||||
"db_path": {workdir + "data/gitea.db"},
|
"db_path": {"data/gitea.db"},
|
||||||
"app_name": {"Gitea: Git with a cup of tea"},
|
"app_name": {"Gitea: Git with a cup of tea"},
|
||||||
"repo_root_path": {workdir + "repositories"},
|
"repo_root_path": {"repositories"},
|
||||||
"run_user": {user},
|
"run_user": {user},
|
||||||
"domain": {"localhost"},
|
"domain": {"localhost"},
|
||||||
"ssh_port": {"22"},
|
"ssh_port": {"22"},
|
||||||
"http_port": {port},
|
"http_port": {port},
|
||||||
"app_url": {"http://localhost:" + port},
|
"app_url": {"http://localhost:" + port},
|
||||||
"log_root_path": {workdir + "log"},
|
"log_root_path": {"log"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,12 +64,7 @@ func install(t *utils.T) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
path, err := filepath.Abs(t.Config.WorkDir)
|
settings := makeSimpleSettings(_user.Username, ServerHTTPPort)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
settings := makeSimpleSettings(_user.Username, path, ServerHTTPPort)
|
|
||||||
r, err = http.PostForm("http://:"+ServerHTTPPort+"/install", settings)
|
r, err = http.PostForm("http://:"+ServerHTTPPort+"/install", settings)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue