添加测试代码

This commit is contained in:
zhangzhe 2024-06-25 14:00:30 +08:00
parent c098f51152
commit 8936b9ff9c
3 changed files with 20 additions and 2 deletions

View File

@ -5,10 +5,13 @@ using Microsoft.AspNetCore.Mvc;
namespace CodeRelease.Controllers namespace CodeRelease.Controllers
{ {
[Route("api/[controller]/[Action]")] [Route("api/[controller]/[Action]")]
[ApiController] [ApiController]
public class PublishController : ControllerBase public class PublishController : ControllerBase
{ {
[HttpGet]
[HttpPost]
/// <summary> /// <summary>
/// 测试 /// 测试
/// </summary> /// </summary>
@ -16,7 +19,7 @@ namespace CodeRelease.Controllers
public async Task<object> Test() public async Task<object> Test()
{ {
LinuxExecuteCommand linuxExecuteCommand = new LinuxExecuteCommand(); LinuxExecuteCommand linuxExecuteCommand = new LinuxExecuteCommand();
var obj = await linuxExecuteCommand.ExecuteCommand(""); var obj = await linuxExecuteCommand.ExecuteCommand("make test -f /disk/CodeRelease/test/makefile");
return obj; return obj;
} }
} }

View File

@ -5,5 +5,14 @@
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://*:5240"
}
}
}
} }

6
test/makefile Normal file
View File

@ -0,0 +1,6 @@
SHELL=/usr/bin/env bash
date_dir_name = $(shell date +"%Y%m%d-%H%M%S")
test:
@echo $(date_dir_name)