feat: 完善远程构建恢复、工程同步与变体选择
增加持久化构建记录、历史 APK 恢复、断点下载、Gradle 缓存复用、系统代理与按工程选择服务端 JDK。 支持已有工程目录、Git 状态检查、原生忽略规则和文本换行等价比较,修复干净检出与历史同步快照不一致时的误拦截。 优化插件设备可选构建、侧栏滚动、左右日志布局、时间显示和构建变体快速选择,并补充部署与协议文档。 验证:17 项 Go 测试、22 项插件测试及 HTTP/HTTPS 两条端到端测试通过;Linux/macOS 服务端交叉编译通过。
This commit is contained in:
1 parent
2203afde3c
commit
2cb70beb69
44 files changed
+3310
-236
No files matched your search
+9
-5
@@ -15,7 +15,11 @@ import (
|
||||
|
||||
func testServer(t *testing.T) *Server {
|
||||
t.Helper()
|
||||
return &Server{root: t.TempDir(), token: "test-token-abcdefghijklmnopqrstuvwxyz", tasks: map[string]bool{":app:assembleDebug": true}, projects: map[string]*Project{}, builds: map[string]*Build{}}
|
||||
root := t.TempDir()
|
||||
config := filepath.Join(root, "environment.json")
|
||||
data, _ := json.Marshal(BuildEnvironment{GradleUserHome: filepath.Join(root, "gradle-cache"), Proxy: "direct"})
|
||||
os.WriteFile(config, data, 0600)
|
||||
return &Server{root: root, environmentFile: config, token: "test-token-abcdefghijklmnopqrstuvwxyz", tasks: map[string]bool{":app:assembleDebug": true}, projects: map[string]*Project{}, builds: map[string]*Build{}}
|
||||
}
|
||||
|
||||
func TestRunningCancellation(t *testing.T) {
|
||||
@@ -114,18 +118,18 @@ func TestSyncAndRevision(t *testing.T) {
|
||||
s := testServer(t)
|
||||
p := project(t, s)
|
||||
path := "/projects/" + p + "/sync"
|
||||
req := SyncRequest{"one", map[string]File{"a.txt": file("hello"), "b.txt": file("remove me")}}
|
||||
req := SyncRequest{Revision: "one", Files: map[string]File{"a.txt": file("hello"), "b.txt": file("remove me")}}
|
||||
if w := call(t, s, "POST", path, req); w.Code != 200 {
|
||||
t.Fatal(w.Body.String())
|
||||
}
|
||||
bad := SyncRequest{"bad", map[string]File{"a.txt": {Hash: "wrong"}}}
|
||||
bad := SyncRequest{Revision: "bad", Files: map[string]File{"a.txt": {Hash: "wrong"}}}
|
||||
if w := call(t, s, "POST", path, bad); w.Code != 400 {
|
||||
t.Fatal(w.Code)
|
||||
}
|
||||
if s.projects[p].Revision != "one" {
|
||||
t.Fatal("invalid sync changed revision")
|
||||
}
|
||||
req = SyncRequest{"two", map[string]File{"a.txt": {Hash: digest([]byte("hello"))}}}
|
||||
req = SyncRequest{Revision: "two", Files: map[string]File{"a.txt": {Hash: digest([]byte("hello"))}}}
|
||||
if w := call(t, s, "POST", path, req); w.Code != 200 {
|
||||
t.Fatal(w.Body.String())
|
||||
}
|
||||
@@ -153,7 +157,7 @@ func TestBuildArtifactAndFailure(t *testing.T) {
|
||||
name = "gradlew.bat"
|
||||
wrapper = "@echo off\r\nmkdir app\\build\\outputs\\apk\\debug 2>nul\r\necho fresh>app\\build\\outputs\\apk\\debug\\app-debug.apk\r\nexit /b 0\r\n"
|
||||
}
|
||||
req := SyncRequest{"one", map[string]File{name: file(wrapper)}}
|
||||
req := SyncRequest{Revision: "one", Files: map[string]File{name: file(wrapper)}}
|
||||
if w := call(t, s, "POST", "/projects/"+p+"/sync", req); w.Code != 200 {
|
||||
t.Fatal(w.Body.String())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user