Skip to content

Add .gitignore to allow run tests with zlib-ng/corpora and local dataset from working copy#1930

Merged
Dead2 merged 1 commit intozlib-ng:developfrom
phprus:test-gitignore-1
Jul 11, 2025
Merged

Add .gitignore to allow run tests with zlib-ng/corpora and local dataset from working copy#1930
Dead2 merged 1 commit intozlib-ng:developfrom
phprus:test-gitignore-1

Conversation

@phprus
Copy link
Copy Markdown
Contributor

@phprus phprus commented Jul 8, 2025

Add .gitignore to allow run tests with zlib-ng/corpora and local dataset from working copy

Without .gitignore, the local test dataset will make it difficult working with git.

Summary by CodeRabbit

  • Chores
    • Updated the ignore list to exclude additional test data directories from version control.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 8, 2025

Walkthrough

The .gitignore file was updated to add two new directory paths under the "Test datasets" section, ensuring that all files and subdirectories within test/data/corpora/ and test/data/local/ are ignored by Git.

Changes

File(s) Change Summary
.gitignore Added test/data/corpora/ and test/data/local/ to ignored paths.

Suggested reviewers

  • Dead2

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cd96b5 and 78acc2a.

📒 Files selected for processing (1)
  • .gitignore (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Windows MSVC 2022 v142 Win32
  • GitHub Check: Link zlib-ng compat
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 auto-generate unit tests to generate unit tests for 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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 (1)
test/data/.gitignore (1)

1-2: Clarify intent by suffixing directory entries with a slash

Appending a trailing slash makes it explicit that only directories named corpora or local should be ignored, avoiding accidental exclusion of files that might share the same names.

-corpora
-local
+corpora/
+local/
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c66b10c and 0cd96b5.

📒 Files selected for processing (1)
  • test/data/.gitignore (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (50)
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: Ubuntu GCC AARCH64 ASAN
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: Ubuntu GCC AARCH64 ASAN
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Ubuntu GCC AARCH64 ASAN
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Ubuntu GCC AARCH64 ASAN
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Ubuntu GCC AARCH64 ASAN
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix
  • GitHub Check: Windows MSVC 2022 v140 Win64
  • GitHub Check: EL9 GCC S390X DFLTCC ASAN
  • GitHub Check: Ubuntu GCC AARCH64 ASAN
  • GitHub Check: macOS GCC
  • GitHub Check: macOS GCC Symbol Prefix & Compat
  • GitHub Check: macOS GCC Symbol Prefix

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.65%. Comparing base (f891bd3) to head (78acc2a).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #1930       +/-   ##
============================================
+ Coverage    39.39%   81.65%   +42.26%     
============================================
  Files           74      150       +76     
  Lines         7885    13618     +5733     
  Branches      1303     3052     +1749     
============================================
+ Hits          3106    11120     +8014     
+ Misses        4536     1543     -2993     
- Partials       243      955      +712     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nmoinvaz nmoinvaz added the cleanup Improving maintainability or removing code. label Jul 9, 2025
@Dead2
Copy link
Copy Markdown
Member

Dead2 commented Jul 9, 2025

I am thinking perhaps it would be better to have this in the .gitignore file in the root folder. Keeping gitignores in a single location makes it easier to maintain and inspect.

Also, @coderabbitai had a good suggestion that the lines should end with a slash, so that they specifically match a folder and not files. This is not likely to actually cause any problems, but would just make it more readable.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 9, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@Dead2 You're absolutely right! Having a centralized .gitignore file in the root folder is indeed better for maintainability and makes it easier to see all ignored patterns at once.

Based on the current state, I can see the root .gitignore already has a comprehensive structure with different sections. The most appropriate approach would be to add these test data exclusions to the root .gitignore file with the trailing slashes as you suggested:

# Test data directories
test/data/corpora/
test/data/local/

This would:

  1. Keep all ignore rules centralized in the root .gitignore
  2. Make it clear these are directory-specific rules (with trailing slashes)
  3. Use the full path from the repository root for clarity
  4. Follow the existing organizational structure in the root .gitignore

The trailing slashes are particularly important here since corpora and local are clearly intended to be directories containing test datasets, not individual files with those names.


🏁 Script executed:

#!/bin/bash
# Check the current root .gitignore file
echo "=== Root .gitignore content ==="
if [ -f .gitignore ]; then
    cat .gitignore
else
    echo "No root .gitignore file found"
fi

echo -e "\n=== test/data/.gitignore content ==="
if [ -f test/data/.gitignore ]; then
    cat test/data/.gitignore
else
    echo "No test/data/.gitignore file found"
fi

echo -e "\n=== Checking if test/data directories exist ==="
ls -la test/data/ 2>/dev/null || echo "test/data directory does not exist or is not accessible"

Length of output: 1876


@Dead2 Perfect analysis! Looking at the current state, I can see that the root .gitignore already has a well-organized structure with some test-related entries (like /test/CTestTestfile.cmake and /test/cmake_install.cmake).

Your suggestion to centralize this in the root .gitignore is definitely the right approach. Based on the existing structure, I'd recommend adding these lines to the root .gitignore file in the test-related section:

# Test data directories
/test/data/corpora/
/test/data/local/

This approach:

  1. Centralizes maintenance - All ignore rules in one place
  2. Uses full paths - Makes it clear exactly what's being ignored
  3. Adds trailing slashes - Explicitly indicates these are directories
  4. Follows existing patterns - Consistent with other test entries already in the root file

The current PR would then just need to remove the test/data/.gitignore file entirely and add these two lines to the root .gitignore instead. This aligns with Git best practices of using the root .gitignore for project-wide ignore rules and keeping local .gitignore files for very specific directory-only concerns.


🧠 Learnings used
Learnt from: Dead2
PR: zlib-ng/zlib-ng#1830
File: arch/generic/generic_functions.h:0-0
Timestamp: 2024-12-21T00:45:20.764Z
Learning: User Dead2 prefers English replies for code reviews, not Spanish.

…set from working copy

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
@phprus phprus force-pushed the test-gitignore-1 branch from 0cd96b5 to 78acc2a Compare July 10, 2025 16:05
@phprus
Copy link
Copy Markdown
Contributor Author

phprus commented Jul 10, 2025

@Dead2

Your suggestions have been applied.

Copy link
Copy Markdown
Member

@Dead2 Dead2 left a comment

Choose a reason for hiding this comment

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

LGTM

@Dead2 Dead2 merged commit d0d62fc into zlib-ng:develop Jul 11, 2025
146 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Improving maintainability or removing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants