Skip to content

fix: basic tests execution update#4192

Merged
denis256 merged 86 commits intomainfrom
windows-test-fix
Apr 25, 2025
Merged

fix: basic tests execution update#4192
denis256 merged 86 commits intomainfrom
windows-test-fix

Conversation

@denis256
Copy link
Copy Markdown
Member

@denis256 denis256 commented Apr 21, 2025

Description

Updated github basic tests execution

Included changes:

  • Added powershell script to configure support for long paths and git settings
  • Updated tests to avoid cross disk links
  • Updated CAS tests to handle windows readonly files
  • Updated tests to handle Windows EOL and Windows paths
  • Updated contribution guide on how to run Windows tests

image

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Summary by CodeRabbit

  • New Features

    • Added a Windows setup script to enhance development environment compatibility and streamline configuration on Windows systems.
  • Bug Fixes

    • Improved cross-platform compatibility by normalizing file paths and handling platform-specific differences in tests and application logic.
    • Enhanced file permission handling and synchronization for Windows environments to ensure consistent behavior.
  • Tests

    • Updated tests to skip or adapt behavior on Windows where necessary, ensuring reliable test execution across platforms.
    • Improved error message assertions and path comparisons for better robustness and platform independence.
    • Introduced new helper functions to detect the operating system and clean string line endings for consistent test results.
    • Adjusted test environment setup to create temporary directories within the current working directory on Windows for better path handling.
  • Refactor

    • Refined internal logic to trim whitespace from module titles and normalize directory paths for improved consistency.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
terragrunt-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 9:07pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 21, 2025

📝 Walkthrough

Walkthrough

This change introduces and enhances cross-platform compatibility, especially for Windows, across the codebase and CI workflows. A new Windows setup PowerShell script is added to configure system and Git settings for long path support and development without a license. The CI workflow is updated to exclude Windows from the test matrix, and numerous test files are modified to normalize file paths, skip tests on Windows where necessary, and handle platform-specific differences in environment variables, file permissions, and error messages. Utility functions are introduced for string and OS normalization, and platform-specific logic is added to core file handling routines and test helpers.

Changes

File(s) Change Summary
.github/scripts/windows-setup.ps1 New PowerShell script for Windows setup: configures Git/system for long paths, developer license, creates C:\bin with symlinks, updates PATH.
.github/workflows/base-test.yml Test matrix now excludes Windows; test step renamed and conditioned to run only on non-Windows OSes with added verbosity and timeout.
cli/app_test.go, cli/commands/list/list_test.go, cli/help_test.go, config/config_helpers_test.go, config/config_test.go, configstack/module_test.go, test/integration_debug_test.go, test/integration_find_test.go, test/integration_locals_test.go, test/integration_serial_test.go, test/integration_windows_test.go, tf/cliconfig/config_test.go, tf/getproviders/package_authentication_test.go, util/file_test.go Tests updated for cross-platform compatibility: path normalization with filepath.ToSlash, conditional skips on Windows, dynamic environment variable syntax, error handling improvements, and robust string comparisons.
cli/commands/catalog/module/module.go, cli/commands/catalog/module/repo.go Path normalization and whitespace trimming added to module title and directory handling for consistency across platforms.
internal/cas/cas.go, internal/cas/content.go Platform-specific file handling: explicit sync and permission management for Windows in blob/content storage.
util/strings.go New utility function CleanString for normalizing line endings to Unix-style.
test/helpers/test_helpers.go New helper function IsWindows() to detect Windows OS at runtime.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant WindowsSetupScript
    participant System
    participant Git
    participant GitHubActionsRunner

    Developer->>WindowsSetupScript: Run windows-setup.ps1
    WindowsSetupScript->>Git: Set long path and compression configs
    WindowsSetupScript->>System: Update registry for long path/dev license
    WindowsSetupScript->>System: Create C:\bin and symlinks
    WindowsSetupScript->>GitHubActionsRunner: Update PATH with C:\bin
Loading

Suggested reviewers

  • levkohimins

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@denis256 denis256 changed the title Fix for Windows integration tests fix: windows integration tests Apr 21, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
docs/_docs/03_community/01-contributing.md (1)

117-126: Enhance navigability by hyperlinking the Windows setup script

It would improve the reader experience to turn the inline code reference to .github/scripts/windows-setup.ps1 into a clickable link. For example:

- For setup instructions and requirements, `.github/scripts/windows-setup.ps1`.
+ For setup instructions and requirements, see the [windows-setup.ps1 script](../../.github/scripts/windows-setup.ps1).
docs-starlight/src/content/docs/03-community/01-contributing.mdx (1)

87-96: Confirm consistency with Jekyll docs and consider hyperlinking the PowerShell script

This new “Testing on Windows” block mirrors the change in the Jekyll docs. To make it easier to locate the setup script, consider replacing the inline path with a markdown link. For example:

- For setup instructions and requirements, `.github/scripts/windows-setup.ps1`.
+ For setup instructions and requirements, see the [windows-setup.ps1 script](../../../.github/scripts/windows-setup.ps1).
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1c46fc and f57f4a1.

📒 Files selected for processing (2)
  • docs-starlight/src/content/docs/03-community/01-contributing.mdx (1 hunks)
  • docs/_docs/03_community/01-contributing.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`docs/**/*.md`: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration under...

docs/**/*.md: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration underway from the Jekyll based documentation in docs to the Starlight + Astro based documentation in docs-starlight. Whenever changes are made to the docs directory, ensure that an equivalent change is made in the docs-starlight directory to keep the docs-starlight documentation accurate.

  • docs/_docs/03_community/01-contributing.md
`docs-starlight/**/*.md*`: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migr...

docs-starlight/**/*.md*: Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration underway from the Jekyll based documentation in docs to the Starlight + Astro based documentation in docs-starlight. Make sure that the docs-starlight documentation is accurate and up-to-date with the docs documentation, and that any difference between them results in an improvement in the docs-starlight documentation.

  • docs-starlight/src/content/docs/03-community/01-contributing.mdx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Pull Request has non-contributor approval
  • GitHub Check: build-and-test

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