You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TESTed is supposed to support test suites that are specific for a single programming language, by specifying a top level programming_language attribute. However, this functionality does not seem to work. Here's an example of a Java-specific test suite
which is more verbose, but also more versatile as it allows to specifiy language-specific statement for individual expressions and statements, also for multiple programming languages. This works, but the former should work as well.
The text was updated successfully, but these errors were encountered:
I did some investigation, and the bug was introduced in #526. In that PR, the jsonschema checking was made much more strict; one of the improvements was checking the Python syntax of the "TESTed" expression literals, instead of raising later during execution.
The problem is that the jsonschema is too strict. The relevant excerpt is:
"expressionOrStatement" : {
"oneOf" : [
{
"type" : "string",
"format" : "tested-dsl-expression",
"description" : "A statement of expression in Python-like syntax as YAML string."
},
{
"description" : "Programming-language-specific statement or expression.",
"type" : "object",
"minProperties" : 1,
"propertyNames" : {
"$ref" : "#/definitions/programmingLanguage"
},
"items" : {
"type" : "string",
"description" : "A language-specific literal, which will be used verbatim."
}
}
]
},
When encountering a string, the string is marked as having the format tested-dsl-expression, which triggers the Python syntax checking.
This is annoying to fix I think. Currently, I see this as the "proper" solution:
Make the json schema much more complex, by introducing different possibilities based on the presence of the programming_language attribute at a level above. E.g. if we encounter this attribute on the tab level, we should add a tab variant to the jsonschema where the expressions are normal strings, but we also need this for every other level where this is supported. Together with the existing support for tabs/units this will result in a rather complex and long json schema.
So, conceptually, instead of having a jsonschema like this:
TESTed is supposed to support test suites that are specific for a single programming language, by specifying a top level
programming_language
attribute. However, this functionality does not seem to work. Here's an example of a Java-specific test suiteThis does not work, and should be a shorthand for
which is more verbose, but also more versatile as it allows to specifiy language-specific statement for individual expressions and statements, also for multiple programming languages. This works, but the former should work as well.
The text was updated successfully, but these errors were encountered: