Fix unit tests and CI workflow for yamlfmt functionality#1
Closed
Fix unit tests and CI workflow for yamlfmt functionality#1
Conversation
Co-authored-by: gouzil <66515297+gouzil@users.noreply.github.com>
Co-authored-by: gouzil <66515297+gouzil@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] @PFCCLab/google-yamlfmt/pull/17 修复一下 单测
Fix unit tests and CI workflow for yamlfmt functionality
Jul 4, 2025
Owner
|
不应该有 development mode,在任何情况下他都应该有二进制文件 |
Co-authored-by: gouzil <66515297+gouzil@users.noreply.github.com>
Author
已修复,现在yamlfmt二进制文件在任何情况下都会可用。我移除了所有"development mode"逻辑,并更新了构建系统以确保二进制文件始终包含在内。如果二进制文件缺失,还添加了自动下载回退机制。所有测试现在都通过且不再跳过任何测试。Commit: 980f002 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the unit tests that were added in PR PFCCLab#17 from PFCCLab/google-yamlfmt. The original tests had several issues that prevented them from running correctly.
Issues Fixed
1. Test Logic Problems
-version,--version,-V) and fall back to help flag2. Assertion Issues
3. GitHub Actions Workflow
i686,armv7lmacosx_10_9tomacosx_10_124. Build System Improvements
hatch_build.pyto handle development installs gracefully whenCIBW_ARCHSandCIBW_PLATFORMenvironment variables are not setTest Results
The tests now work correctly in both environments:
Code Quality
ruffFiles Changed
tests/test_yamlfmt.py- Fixed test logic and error handlingtests/README.md- Added comprehensive test documentationtests/test_input.yaml- Test fixture for YAML formattingtests/__init__.py- Made tests directory a proper Python package.github/workflows/release.yaml- Added test job and updated build matrixhatch_build.py- Fixed development install supportThis resolves the "修复一下 单测" (fix the unit tests) issue mentioned in the original PR.
💡 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.