-
Notifications
You must be signed in to change notification settings - Fork 753
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
Support validating test labels using the test runner #35308
Merged
pcnfernando
merged 8 commits into
ballerina-platform:spec-conformance-test-runner
from
lasinicl:spec-conformance-test-runner
Mar 9, 2022
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
26fd9a2
Add test case label validation
lasinicl 3bf84ef
Update labels
lasinicl 345425d
Refactor code
lasinicl ee7ebbf
Ensure that only the particular test fails
lasinicl 94fa7a6
Add suggested changes
lasinicl 49f195b
Add labels
lasinicl eaaae96
Add suggested change
lasinicl 7f9e8ab
Add line number
lasinicl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
216 changes: 162 additions & 54 deletions
216
tests/ballerina-spec-conformance-tests/src/test/resources/labels.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,180 @@ | ||
Label,Implies | ||
any | ||
boolean | ||
byte | ||
decimal | ||
float | ||
int | ||
null | ||
panic | ||
string | ||
var | ||
any, | ||
boolean, | ||
byte, | ||
decimal, | ||
float, | ||
int, | ||
null, | ||
panic, | ||
string, | ||
var, | ||
int:Signed32,int | ||
int:Unsigned32,int | ||
int:abs,int | ||
int:max,int | ||
int:MAX_VALUE,int | ||
int:MIN_VALUE,int | ||
value:toBalString | ||
value:toBalString, | ||
float:PI,float | ||
equality | ||
exact-equality | ||
equality, | ||
exact-equality, | ||
infinity,float | ||
nan,float | ||
numeric-nil-lifting | ||
numeric-nil-lifting, | ||
panic-arithmetic-overflow,panic | ||
signed-zero | ||
signed-zero, | ||
StringNumericEscape,StringEscape | ||
unary-complement | ||
unary-minus | ||
unary-not | ||
unary-plus | ||
additive-expr | ||
binary-bitwise-expr | ||
unary-complement, | ||
unary-minus, | ||
unary-not, | ||
unary-plus, | ||
additive-expr, | ||
binary-bitwise-expr, | ||
byte-array-literal,"byte, array-type" | ||
DecimalTypeSuffix,decimal | ||
FloatTypeSuffix,float | ||
HexFloatingPointLiteral,float | ||
HexIntLiteral,int | ||
is-expr | ||
logical-expr | ||
module-type-defn | ||
multiplicative-expr | ||
nil-literal | ||
shift-expr | ||
is-expr, | ||
logical-expr, | ||
module-type-defn, | ||
multiplicative-expr, | ||
nil-literal, | ||
shift-expr, | ||
StringEscape,string | ||
type-cast-expr | ||
type-cast-expr, | ||
raw-template-expr,BacktickString | ||
while-stmt,boolean | ||
BacktickString | ||
array-type | ||
map-type | ||
optional-type | ||
record-type | ||
singleton-type | ||
tuple-type | ||
union-type | ||
nil-type | ||
mapping-constructor-expr | ||
list-constructor-expr | ||
table-constructor-expr | ||
intersection-type | ||
readonly-type | ||
member-access-expr | ||
foreach-stmt | ||
method-call-expr | ||
match-stmt | ||
iterable-mapping | ||
iterable-list | ||
iterable-exclusive | ||
iterable-inclusive | ||
iterable-string | ||
iterable-object | ||
BacktickString, | ||
array-type, | ||
map-type, | ||
optional-type, | ||
record-type, | ||
singleton-type, | ||
tuple-type, | ||
union-type, | ||
nil-type, | ||
mapping-constructor-expr, | ||
list-constructor-expr, | ||
table-constructor-expr, | ||
intersection-type, | ||
readonly-type, | ||
member-access-expr, | ||
foreach-stmt, | ||
iterable-mapping, | ||
iterable-list, | ||
iterable-exclusive, | ||
iterable-inclusive, | ||
iterable-string, | ||
iterable-object, | ||
method-call-expr, | ||
match-stmt, | ||
int:SIGNED32_MAX_VALUE,int:Signed32 | ||
int:SIGNED32_MIN_VALUE,int:Signed32 | ||
int:SIGNED16_MAX_VALUE,int:Signed16 | ||
int:SIGNED16_MIN_VALUE,int:Signed16 | ||
int:SIGNED8_MAX_VALUE,int:Signed8 | ||
int:SIGNED8_MIN_VALUE,int:Signed8 | ||
int:UNSIGNED32_MAX_VALUE,int:Unsigned32 | ||
int:UNSIGNED16_MAX_VALUE,int:Unsigned16 | ||
int:UNSIGNED8_MAX_VALUE,int:Unsigned8 | ||
int:sum,int | ||
int:min,int | ||
int:fromString,int | ||
int:toHexString,int | ||
int:fromHexString,int | ||
int:Signed8,int | ||
int:Unsigned8,int | ||
int:Signed16,int | ||
int:Unsigned16,int | ||
function-defn, | ||
function-call-expr, | ||
local-init-var-decl-stmt, | ||
variable-reference-expr, | ||
if-else-stmt, | ||
boolean-literal, | ||
DecimalNumber, | ||
return-stmt, | ||
StringSingleEscape,StringEscape | ||
defaultable-param,function-signature | ||
field-access-expr, | ||
optional-field-access-expr, | ||
module-class-defn, | ||
implicit-new-expr,new-expr | ||
explicit-new-expr,new-expr | ||
check,checking-expr | ||
checkpanic,checking-expr | ||
json, | ||
xml, | ||
xml:Element,xml | ||
xml:ProcessingInstruction,xml | ||
xml:Comment,xml | ||
xml:Text,xml | ||
xml-type-parameter,xml | ||
module-const-decl, | ||
lax-typing, | ||
computed-name-field,mapping-constructor-expr | ||
spread-field,mapping-constructor-expr | ||
DecimalFloatingPointNumber, | ||
ternary-conditional-expr,conditional-expr | ||
binary-conditional-expr,conditional-expr | ||
let-expr, | ||
relational-expr, | ||
anydata, | ||
FloatingPointTypeSuffix, | ||
string:Char,string | ||
error-constructor-expr, | ||
error-type, | ||
error-type-parameter,error | ||
never, | ||
record-type-inclusion, | ||
readonly-field,record-type | ||
module-init-var-decl, | ||
module-no-init-var-decl, | ||
record-rest-descriptor,record-type | ||
string-template-expr,"BacktickString, string" | ||
xml-template-expr,"BacktickString, xml" | ||
object-type, | ||
object-constructor-expr,object-type | ||
xml-required-attribute-access-expr, | ||
xml-optional-attribute-access-expr, | ||
annot-access-expr, | ||
annotation-decl, | ||
annotation, | ||
explicit-anonymous-function-expr, | ||
infer-anonymous-function-expr, | ||
function-type, | ||
typeof-expr, | ||
trap-expr, | ||
query-expr, | ||
transactional-expr, | ||
xml-filter-expr, | ||
xml-step-expr, | ||
table-type, | ||
key-specifier, | ||
xmlns-decl, | ||
typedesc-type, | ||
range-expr, | ||
transaction-stmt, | ||
retry-transaction-stmt, | ||
commit-action, | ||
future, | ||
future-type-parameter, | ||
distinct, | ||
handle, | ||
stream, | ||
stream-type-parameters, | ||
transactional-function, | ||
transactional-method, | ||
transactional-worker, | ||
start-action, | ||
const-reference-expr, | ||
type-reference, | ||
string:length, | ||
xml:length, | ||
rollback-stmt, | ||
transaction:onRollback, | ||
isolated-function, | ||
transaction:Info, | ||
error:Retriable, | ||
compound-assignment-stmt, | ||
transaction:onCommit |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we propagate the line number here and log it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the line number of the test case or the line number of the label? We don't seem to keep information on the line numbers of the labels ATM though. Will need to add support for this if that's the requirement here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line number in the test case. Specifically .balt file.
Isn't
absLineNum
argument TestRunner.test() represent that?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data provider provides the
absLineNum
. The line number of the last row of the labels will beabsLineNum - 1
right?If there's more than one row of labels, right now we can't pinpoint the row.
But for now, we can log the error to the last line in case of the label list contains duplicates/unknowns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. But anyway we can see which test has failed right?. Then, we can just check and correct the label there. If we can't pinpoint the row I don't think it makes any difference, even if log the error to the last line since we'll anyway have to find where the label exactly is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin-pointing the raw is not needed. Just the line number will be useful as I see it. It's matter of checking the label string in the test.
Does the failed test pin-point to the specific line on the original balt. No right?
I think logging the
absLineNum
would be enough for the moment and it will be really useful. Theat's what I felt trying out your changes against .balt filesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, added the line number in 7f9e8ab