From 0bf8d28e2254fa3a26378d2540349d98c7930737 Mon Sep 17 00:00:00 2001 From: mango <1711456624@qq.com> Date: Mon, 27 Jul 2026 19:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90=E4=B8=8E?= =?UTF-8?q?=20Java=20=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-tests.yml | 6 ++++++ internal/jvm/agent_provider_test.go | 3 ++- internal/jvm/http_provider_test.go | 3 ++- internal/jvm/jmx_provider_test.go | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index dad26ddc..0ae7d495 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -35,6 +35,12 @@ jobs: distribution: temurin java-version: '17' + - name: Prepare frontend embed + shell: bash + run: | + mkdir -p frontend/dist + printf 'GoNavi test\n' > frontend/dist/index.html + - name: Run backend tests run: go test ./... -count=1 -timeout=30m diff --git a/internal/jvm/agent_provider_test.go b/internal/jvm/agent_provider_test.go index 4261e1e0..567ffa16 100644 --- a/internal/jvm/agent_provider_test.go +++ b/internal/jvm/agent_provider_test.go @@ -244,7 +244,8 @@ func startAgentFixture(t *testing.T) agentFixtureProcess { t.Fatalf("expected agent fixture java files under %s", sourceRoot) } - compileCmd := exec.Command(javacBin, append([]string{"-d", classesDir}, javaFiles...)...) + compileArgs := append([]string{"-encoding", "UTF-8", "-d", classesDir}, javaFiles...) + compileCmd := exec.Command(javacBin, compileArgs...) output, err := compileCmd.CombinedOutput() if err != nil { t.Fatalf("compile agent fixture failed: %v\n%s", err, strings.TrimSpace(string(output))) diff --git a/internal/jvm/http_provider_test.go b/internal/jvm/http_provider_test.go index 4246741a..c89b8b08 100644 --- a/internal/jvm/http_provider_test.go +++ b/internal/jvm/http_provider_test.go @@ -534,7 +534,8 @@ func startEndpointFixture(t *testing.T) endpointFixtureProcess { t.Fatalf("expected endpoint fixture java files under %s", sourceRoot) } - compileCmd := exec.Command(javacBin, append([]string{"-d", classesDir}, javaFiles...)...) + compileArgs := append([]string{"-encoding", "UTF-8", "-d", classesDir}, javaFiles...) + compileCmd := exec.Command(javacBin, compileArgs...) output, err := compileCmd.CombinedOutput() if err != nil { t.Fatalf("compile endpoint fixture failed: %v\n%s", err, strings.TrimSpace(string(output))) diff --git a/internal/jvm/jmx_provider_test.go b/internal/jvm/jmx_provider_test.go index e9b574d7..ea407aa4 100644 --- a/internal/jvm/jmx_provider_test.go +++ b/internal/jvm/jmx_provider_test.go @@ -788,7 +788,8 @@ func startJMXFixture(t *testing.T) jmxFixtureProcess { t.Fatalf("expected fixture java files under %s", sourceRoot) } - compileCmd := exec.Command(javacBin, append([]string{"-d", classesDir}, javaFiles...)...) + compileArgs := append([]string{"-encoding", "UTF-8", "-d", classesDir}, javaFiles...) + compileCmd := exec.Command(javacBin, compileArgs...) output, err := compileCmd.CombinedOutput() if err != nil { t.Fatalf("compile fixture failed: %v\n%s", err, strings.TrimSpace(string(output)))