-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Yaml parser: implement loadClasses flag #2688
Yaml parser: implement loadClasses flag #2688
Conversation
6667b8c
to
e0701da
Compare
Parser loadClasses flag controls, whether test classes will be loaded during suite parsing. Setting it to false allow to load yaml suite with non-existent classes, whereas true will fail parsing on test class loading.
e0701da
to
a1f2e3f
Compare
} else { | ||
className = ((ScalarNode) node).getValue(); | ||
} | ||
return c.newInstance(className, loadClasses); |
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.
Can we please use org.testng.internal.objects.InstanceCreator#newInstance(java.lang.reflect.Constructor<T>, java.lang.Object...)
to create the instance ?
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.
done
nodeTuple -> | ||
((ScalarNode) nodeTuple.getKeyNode()).getValue().equals("name")) | ||
.findFirst() | ||
.orElseThrow(RuntimeException::new) |
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.
Can we consider throwing org.testng.TestNGException
instead with a proper error message that explains what went wrong ?
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.
done
CHANGES.txt
Outdated
@@ -1,4 +1,5 @@ | |||
Current | |||
New: Yaml parser: implement loadClasses flag (Dzmitry Sankouski) |
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.
Just for traceability, it would be good if you could please help do the following:
- Log a bug that explains the problem
- Refer to that bug id here so that the changeset information is available in the
CHANGES.txt
- Add a reference to the issue in the
description
attribute of@Test
test, so that we know that the test belongs to a specific defect.
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.
done
closes #2689 |
- use InstanceCreator#newInstance() - use TestNG exception with detail exception message - create and link github issue
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.
@juherr - Can you please help take a quick look from your side as well ?
Parser loadClasses flag controls, whether test classes will be loaded during
suite parsing. Setting it to false allow to load yaml suite with non-existent
classes, whereas true will fail parsing on test class loading.
Did you remember to?
CHANGES.txt
./gradlew autostyleApply