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

Clean up ExprFunction test #529

Merged
merged 5 commits into from
Feb 19, 2022
Merged

Clean up ExprFunction test #529

merged 5 commits into from
Feb 19, 2022

Conversation

lziq
Copy link
Contributor

@lziq lziq commented Feb 18, 2022

Description of Changes

  1. For each ExprFunction test, used one parameterized test to cover all pass test cases.
  2. For each ExprFunction test, used one parameterized test to cover all invalid arguments test cases.
  3. Created InvalidArgTypeChecker to automatically generate invalid argument type test cases for each ExprFunction.
  4. Created InvalidArityChecker to automatically generate invalid arity test cases for each ExprFunction.

The first 4 commits are not relevant.

@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2022

Codecov Report

Merging #529 (3ca8278) into main (e3cbe1b) will decrease coverage by 0.19%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #529      +/-   ##
============================================
- Coverage     80.91%   80.72%   -0.20%     
+ Complexity     1687     1681       -6     
============================================
  Files           196      196              
  Lines         14305    14307       +2     
  Branches       2944     2944              
============================================
- Hits          11575    11549      -26     
- Misses         1776     1798      +22     
- Partials        954      960       +6     
Flag Coverage Δ
CLI 26.53% <ø> (ø)
EXAMPLES 74.49% <ø> (ø)
LANG 82.53% <75.00%> (-0.22%) ⬇️
PTS ∅ <ø> (∅)
TEST_SCRIPT 76.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lang/src/org/partiql/lang/eval/Exceptions.kt 77.77% <71.42%> (-3.00%) ⬇️
lang/src/org/partiql/lang/syntax/SqlParser.kt 77.00% <100.00%> (ø)
...partiql/lang/eval/builtins/MakeDateExprFunction.kt 58.33% <0.00%> (-33.34%) ⬇️
...org/partiql/lang/eval/builtins/TrimExprFunction.kt 72.88% <0.00%> (-8.48%) ⬇️
.../partiql/lang/eval/builtins/ExtractExprFunction.kt 75.86% <0.00%> (-6.90%) ⬇️
.../partiql/lang/eval/builtins/DateAddExprFunction.kt 84.74% <0.00%> (-5.09%) ⬇️
...artiql/lang/eval/builtins/SubstringExprFunction.kt 73.91% <0.00%> (-4.35%) ⬇️
...g/src/org/partiql/lang/eval/ExprValueExtensions.kt 82.86% <0.00%> (-1.75%) ⬇️
...ng/src/org/partiql/lang/eval/EvaluatingCompiler.kt 81.01% <0.00%> (-0.11%) ⬇️
lang/src/org/partiql/lang/eval/Thunk.kt 81.97% <0.00%> (+0.58%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3cbe1b...3ca8278. Read the comment docs.

Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

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

Changes already approved previously :shipit: . Can you also add a more detailed PR description?

@@ -441,7 +441,7 @@ class SqlParser(
else -> errMalformedParseTree("Unsupported path component: ${it.type}")
}
}
path(rootExpr, pathComponents, metas)
path(rootExpr, pathComponents, rootExpr.metas) // Here we use its root source location, since itself has no source location (not a token).
Copy link
Member

Choose a reason for hiding this comment

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

nit: for future PRs, it would be helpful to start with a clean commit history (i.e. not including commits from other PRs). GitHub shows this as a changed file even though your target branch, main, already has this change, which can be confusing for the reviewer.

You could start by creating the branch directly off of main:

git checkout main
git pull
git checkout feature-branch
... (make and commit changes) ...
... (create PR with feature-branch) ...

If the origin GitHub branch already has the commits, you can rebase and force push to the origin branch.

@lziq lziq merged commit 7f07dc3 into main Feb 19, 2022
@lziq lziq deleted the clean-up-ExprFunction-test branch February 19, 2022 02:05
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.

3 participants