...
This commit is contained in:
@@ -38,7 +38,7 @@ pub fn get(args_ ArgsGet) !&${args.classname} {
|
|||||||
mut args := args_get(args_)
|
mut args := args_get(args_)
|
||||||
mut obj := ${args.classname}{}
|
mut obj := ${args.classname}{}
|
||||||
if !(args.name in ${args.name}_global) {
|
if !(args.name in ${args.name}_global) {
|
||||||
if ! exists(args){
|
if ! exists(args)!{
|
||||||
set(obj)!
|
set(obj)!
|
||||||
}else{
|
}else{
|
||||||
heroscript := context.hero_config_get("${args.name}",args.name)!
|
heroscript := context.hero_config_get("${args.name}",args.name)!
|
||||||
|
|||||||
@@ -31,18 +31,15 @@ fn args_get (args_ ArgsGet) ArgsGet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get(args_ ArgsGet) !&GiteaServer {
|
pub fn get(args_ ArgsGet) !&GiteaServer {
|
||||||
mut context := base.context()!
|
mut context:=base.context()!
|
||||||
mut args := args_get(args_)
|
mut args := args_get(args_)
|
||||||
mut obj := GiteaServer{
|
mut obj := GiteaServer{}
|
||||||
domain: 'localhost' // Default domain, should be overridden by configuration
|
|
||||||
}
|
|
||||||
if !(args.name in gitea_global) {
|
if !(args.name in gitea_global) {
|
||||||
exists_res := exists(args) or { false }
|
if ! exists(args)!{
|
||||||
if !exists_res {
|
|
||||||
set(obj)!
|
set(obj)!
|
||||||
} else {
|
}else{
|
||||||
heroscript := context.hero_config_get("gitea", args.name)!
|
heroscript := context.hero_config_get("gitea",args.name)!
|
||||||
mut obj2 := heroscript_loads(heroscript)!
|
mut obj2:=heroscript_loads(heroscript)!
|
||||||
set_in_mem(obj2)!
|
set_in_mem(obj2)!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ pub mut:
|
|||||||
name string = 'default'
|
name string = 'default'
|
||||||
path string = '${os.home_dir()}/hero/var/gitea'
|
path string = '${os.home_dir()}/hero/var/gitea'
|
||||||
passwd string
|
passwd string
|
||||||
domain string @[required]
|
domain string = "git.test.com"
|
||||||
jwt_secret string = rand.hex(12)
|
jwt_secret string = rand.hex(12)
|
||||||
lfs_jwt_secret string
|
lfs_jwt_secret string
|
||||||
internal_token string
|
internal_token string
|
||||||
@@ -43,7 +43,7 @@ fn obj_init(mycfg_ GiteaServer)!GiteaServer{
|
|||||||
fn configure() ! {
|
fn configure() ! {
|
||||||
mut server := get()!
|
mut server := get()!
|
||||||
|
|
||||||
if !osal.cmd_exists('gitea')! {
|
if !osal.cmd_exists('gitea') {
|
||||||
return error('gitea binary not found in path. Please install gitea first.')
|
return error('gitea binary not found in path. Please install gitea first.')
|
||||||
}
|
}
|
||||||
// Generate and set any missing secrets
|
// Generate and set any missing secrets
|
||||||
|
|||||||
@@ -85,28 +85,20 @@ fn process_test_file(path string, base_dir string, test_files_ignore []string, t
|
|||||||
|
|
||||||
// Check if any ignore pattern matches the path
|
// Check if any ignore pattern matches the path
|
||||||
for pattern in test_files_ignore {
|
for pattern in test_files_ignore {
|
||||||
if pattern.trim_space() != '' && rel_path.contains(pattern) {
|
if pattern.trim_space() != '' && rel_path.contains(pattern.trim_space()) {
|
||||||
should_ignore = true
|
println('Ignoring test: ${rel_path}')
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if any error pattern matches the path
|
// Check if any error pattern matches the path
|
||||||
for pattern in test_files_error {
|
for pattern in test_files_error {
|
||||||
if pattern.trim_space() != '' && rel_path.contains(pattern) {
|
if pattern.trim_space() != '' && rel_path.contains(pattern.trim_space()) {
|
||||||
is_error = true
|
println('Ignoring test because is error: ${rel_path}')
|
||||||
break
|
return
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !should_ignore && !is_error {
|
|
||||||
dotest(norm_path, base_dir, mut cache)!
|
|
||||||
} else {
|
|
||||||
println('Ignoring test: ${rel_path}')
|
|
||||||
if !should_ignore {
|
|
||||||
tests_in_error << rel_path
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dotest(norm_path, base_dir, mut cache)!
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dotest(path string, base_dir string, mut cache TestCache) ! {
|
fn dotest(path string, base_dir string, mut cache TestCache) ! {
|
||||||
@@ -189,6 +181,8 @@ if os.exists("/home/runner"){
|
|||||||
tests_ignore+="\nosal/tmux\n"
|
tests_ignore+="\nosal/tmux\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println(tests_ignore)
|
||||||
|
|
||||||
tests_error := '
|
tests_error := '
|
||||||
tmux_window_test.v
|
tmux_window_test.v
|
||||||
tmux_test.v
|
tmux_test.v
|
||||||
|
|||||||
Reference in New Issue
Block a user