Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace run!, test! and count! macros in test-suite to Tester methods, #1368

Merged
merged 10 commits into from
Aug 12, 2023

Conversation

panarch
Copy link
Member

@panarch panarch commented Aug 6, 2023

Add run, count, test and named_test methods to Tester instance.
Apply pretty_assertions::assert_eq.

  1. run
// before
run!("SELECT * From Foo;");

// after
g.run("SELECT * FROM Foo;").await.unwrap();
  1. test
// as-is
test! {
    sql: "SELECT * FROM Foo",
    expected: Ok(select!( .. ))
};

// to-be
g.test(
    "SELECT * FROM Foo",
    Ok(select!( .. ));
).await
  1. migrations
    migration work for existing test-suite modules are also simple.
    e.g. test-suite/src/case.rs
// as-is
for (sql, expected) in test_cases {
    test!(sql, expected);
}

// to-be
let g = get_tester!();

for (sql, expected) in test_cases {
    g.test(sql, expected).await;
}

remaining tasks

  • metadata
  • index
  • function
  • data_type
  • arithmetic
  • alter
  • aggregate
  • remove legacy macros - run!, test!, etc.

Add run, count, test and named_test methods to Tester instance.
Apply to basic & case tests.
Apply pretty_assertions::assert_eq.
@panarch panarch added the improvement Improvements for existing features label Aug 6, 2023
@coveralls
Copy link

coveralls commented Aug 6, 2023

Pull Request Test Coverage Report for Build 5828732702

  • 3444 of 3449 (99.86%) changed or added relevant lines in 143 files are covered.
  • 15 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.3%) to 99.209%

Changes Missing Coverage Covered Lines Changed/Added Lines %
test-suite/src/tester/mod.rs 38 43 88.37%
Files with Coverage Reduction New Missed Lines %
core/src/ast/mod.rs 1 99.83%
test-suite/src/tester/mod.rs 14 76.82%
Totals Coverage Status
Change from base Build 5828085361: 0.3%
Covered Lines: 48174
Relevant Lines: 48558

💛 - Coveralls

@panarch panarch marked this pull request as ready for review August 10, 2023 10:53
@panarch panarch merged commit 695a9bd into main Aug 12, 2023
9 checks passed
@panarch panarch deleted the reduce-macro-uses-in-test-suite branch August 12, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvements for existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants