Skip to content

add asan test#855

Closed
suketa wants to merge 44 commits intomainfrom
ruby-asan
Closed

add asan test#855
suketa wants to merge 44 commits intomainfrom
ruby-asan

Conversation

@suketa
Copy link
Owner

@suketa suketa commented Jan 10, 2025

try using ruby-asan CI test

Summary by CodeRabbit

  • New Features

    • Added a new GitHub Actions workflow for Ruby testing with AddressSanitizer (ASan)
    • Introduced a new test method for DuckDB ASan testing
  • Improvements

    • Enhanced error handling in prepared statement initialization
    • Improved error message clarity for database connection issues
  • Chores

    • Set up continuous integration testing across multiple DuckDB versions

@suketa suketa marked this pull request as draft January 10, 2025 21:33
@suketa suketa marked this pull request as ready for review January 11, 2025 06:18
@suketa suketa marked this pull request as draft January 11, 2025 06:31
suketa added 16 commits January 11, 2025 16:08
```
    def test_with_ruby_asan
      puts 'insert with prepared statement and select'
      db = DuckDB::Database.open
      con = db.connect
      con.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, name VARCHAR(100))')
      stmts = DuckDB::ExtractedStatements.new(con, "INSERT INTO test VALUES (1, 'hello')")
      stmts.each do |stmt|
        stmt.execute
        stmt.destroy
      end
      result = con.execute('SELECT * FROM test WHERE id = ?', 1)
    end
```
This reverts commit f5f026a.
This reverts commit dbe82f2.

```
    def test_with_ruby_asan
      db = DuckDB::Database.open
      con = db.connect
      con.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, name VARCHAR(100))')
      con.execute("INSERT INTO test VALUES (1, 'hello')")
      puts 'ExtractedStatements#each with PreapredStatement#(execute|destroy)'
      stmts = DuckDB::ExtractedStatements.new(con, "INSERT INTO test VALUES (1, 'hello')")
      stmts.each do |stmt|
        stmt.execute
        stmt.destroy
      end
      result = con.execute('SELECT * FROM test WHERE id = ?', 1)
    end
```
This reverts commit f22dd50.
@coderabbitai
Copy link

coderabbitai bot commented Jan 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new GitHub Actions workflow has been introduced to automate testing for a Ruby project using AddressSanitizer (ASan) on Ubuntu. The workflow tests the project against multiple DuckDB versions (1.1.3, 1.1.1, 1.0.0) and includes steps for code checkout, Ruby setup, DuckDB caching, dependency installation, and test execution. Additionally, changes were made to the prepared statement initialization in the C extension and a new test method was added to validate ASan functionality.

Changes

File Change Summary
.github/workflows/ruby_asan_on_ubuntu.yml New workflow file for ASan testing on Ubuntu with matrix strategy for DuckDB versions
ext/duckdb/prepared_statement.c Modified prepared statement initialization with improved local variable handling and error reporting
test/duckdb_test/ruby_asan_test.rb Added run_duckdb_asan_test method for testing database connection and statement preparation

Sequence Diagram

sequenceDiagram
    participant GA as GitHub Actions
    participant Ruby as Ruby Environment
    participant DuckDB as DuckDB Build
    participant Test as Test Suite

    GA->>Ruby: Set up Ruby version
    GA->>DuckDB: Cache or Build DuckDB
    Ruby->>Test: Install dependencies
    Ruby->>Test: Build with/without deprecated API
    Test->>DuckDB: Prepare and execute statements
    GA->>Test: Run tests with ASan
Loading

Poem

🐰 In the realm of code, a rabbit's delight,
ASan workflows now shine so bright!
DuckDB versions dance and play,
Testing magic on Ubuntu's way 🧪
Sanitized and swift, our code takes flight! 🚀


📜 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 4064bb2 and 3677a10.

📒 Files selected for processing (3)
  • .github/workflows/ruby_asan_on_ubuntu.yml (1 hunks)
  • ext/duckdb/prepared_statement.c (1 hunks)
  • test/duckdb_test/ruby_asan_test.rb (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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. (Beta)
  • @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.

@suketa
Copy link
Owner Author

suketa commented Jan 24, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 24, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@suketa suketa closed this Jan 24, 2025
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