Skip to content

StandardLibrary.Tests и DocumenterTests в юнит-тестах сборки - #1786

Open
sfaqer wants to merge 1 commit into
EvilBeaver:developfrom
sfaqer:ci/unit-tests-all
Open

sfaqer wants to merge 1 commit into
EvilBeaver:developfrom
sfaqer:ci/unit-tests-all

Conversation

@sfaqer

@sfaqer sfaqer commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Цель UnitTests в Build.csproj запускала только Core, DebugProtocol, Dynamic и Language — тесты OneScript.StandardLibrary.Tests и DocumenterTests не гонялись ни в Jenkins, ни в GA. Добавил их в список и JunitXml.TestLogger в их csproj (без него --logger:junit не пишет отчет).

Сразу всплыли два теста, зависящих от окружения:

  • MarkdownWriterTests ждал \r\n, а MarkdownWriter пишет Environment.NewLine — на Linux и macOS падал;
  • TimeZoneConverterTests брал Europe/Kiev, а на Windows в режиме NLS (без ICU) .NET не понимает имена часовых поясов IANA. В этом режиме, судя по тестам formatting.os (они ждут форматы дат NLS и проходят), работает и Windows-агент Jenkins. Заменил на FLE Standard Time — тот же пояс, находится и с NLS, и с ICU.

Проверено сборкой GA на Windows, Linux и macOS: https://github.com/sfaqer/OneScript/actions/runs/36977888289

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded automated test coverage to include standard library and documentation tests.
    • Improved test consistency across operating systems by normalizing line endings and using a Windows time-zone identifier in daylight-saving conversion checks.
    • Added support for exporting test results in JUnit XML format.

Цель UnitTests запускала только Core, DebugProtocol, Dynamic и Language,
поэтому тесты стандартной библиотеки и документатора не гонялись ни в
Jenkins, ни в GA. Добавил их и JunitXml.TestLogger, без которого
--logger:junit не пишет отчет.

Сразу всплыли два теста, зависящих от окружения: MarkdownWriterTests
ждал \r\n, а MarkdownWriter пишет Environment.NewLine; TimeZoneConverterTests
брал Europe/Kiev, который на Windows в режиме NLS (без ICU) не находится -
теперь FLE Standard Time, тот же пояс.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
CODESTYLE.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: af82d4f0-145b-420f-b45a-78c8eb162acf

📥 Commits

Reviewing files that changed from the base of the PR and between f780bb4 and 5f9476a.

📒 Files selected for processing (5)
  • Build.csproj
  • src/Tests/DocumenterTests/DocumenterTests.csproj
  • src/Tests/DocumenterTests/MarkdownWriterTests.cs
  • src/Tests/OneScript.StandardLibrary.Tests/OneScript.StandardLibrary.Tests.csproj
  • src/Tests/OneScript.StandardLibrary.Tests/TimeZoneConverterTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The changes register two test assemblies, add JunitXml.TestLogger references, and update Markdown line-ending and time-zone conversion test inputs.

Changes

Test suite updates

Layer / File(s) Summary
Test assembly and logger configuration
Build.csproj, src/Tests/DocumenterTests/DocumenterTests.csproj, src/Tests/OneScript.StandardLibrary.Tests/OneScript.StandardLibrary.Tests.csproj
UnitTests now includes OneScript.StandardLibrary.Tests and DocumenterTests. Both test projects reference JunitXml.TestLogger version 3.0.124.
Markdown list line-ending assertions
src/Tests/DocumenterTests/MarkdownWriterTests.cs
Two list tests normalize expected strings with ReplaceLineEndings() before comparing them with the writer output.
Time-zone conversion test
src/Tests/OneScript.StandardLibrary.Tests/TimeZoneConverterTests.cs
The daylight-saving test uses FLE Standard Time for both conversions. Expected timestamps remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5f947

This change expands test coverage and makes two tests more portable, with no identified production impact. It is safe to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding StandardLibrary.Tests and DocumenterTests to the build's unit-test target.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonar-openbsl-ru-qa-bot

Copy link
Copy Markdown

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.

1 participant