Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

CI tests failed on Ubuntu due to character encoding mismatch and incorrect build script invocation. 13/804 tests were failing because test files used GB2312 encoding while source code uses UTF-8, causing Chinese character assertions to fail.

Changes

  • Convert test files to UTF-8: RecordTests.cs and HttpResponseMessageExtensionsTests.cs from GB2312 → UTF-8
  • Fix workflow command: Remove Windows build.cmd fallback on Linux, use ./build.sh Test directly

The encoding issue manifested as:

// Test assertion (was GB2312 encoded)
Assert.IsTrue(exception.Message.Contains("行索引 -1 超出有效范围"));

// Source exception message (UTF-8)
throw new ArgumentOutOfRangeException(nameof(row), $"行索引 {row} 超出有效范围 [0, {Record.Count - 1}]");

All 804 tests now pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>解决测试报错</issue_title>
<issue_description>以下 nuke-test.yml 文件测试 ci、cd 报错。但是 Windows 上我没有复现。

name: Run Nuke Test on Push

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 10.0.x  # 更新至实际使用的 .NET 版本

      - name: Restore dependencies
        run: dotnet restore

      - name: Run Nuke Build Test
        run: ./build.cmd Test || ./build.sh Test
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 07:30
Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI/CD test errors in nuke-test.yml Fix test failures in CI/CD: GB2312 encoding and Linux build script Jan 16, 2026
Copilot AI requested a review from Soar360 January 16, 2026 07:36
@Soar360 Soar360 marked this pull request as ready for review January 21, 2026 06:24
Copilot AI review requested due to automatic review settings January 21, 2026 06:24
@Soar360 Soar360 merged commit 6867baf into main Jan 21, 2026
5 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes CI/CD test failures on Ubuntu that were caused by character encoding mismatches between test files and source code. The test files were using GB2312 encoding while the source code uses UTF-8, causing 13 out of 804 tests to fail when validating Chinese error messages.

Changes:

  • Converted Chinese text in test files from GB2312 to UTF-8 encoding to match source code
  • Simplified workflow build command to directly use ./build.sh Test on Linux instead of the fallback pattern

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/LuYao.Common.UnitTests/Data/RecordTests.cs Converted all Chinese comments and exception message assertions from GB2312 to UTF-8
tests/LuYao.Common.UnitTests/Net/Http/HttpResponseMessageExtensionsTests.cs Converted Chinese string literals in test cases from GB2312 to UTF-8
.github/workflows/nuke-test.yml Simplified build command to directly call ./build.sh Test for ubuntu-latest runner

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

解决测试报错

2 participants