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

Add addition yml extension #2837

Merged
merged 3 commits into from Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
@@ -1,4 +1,5 @@
Current
New: Added .yml file extension for yaml suite files, previously only .yaml was allowed for yaml (Steven Jubb)
Fixed: GITHUB-2770: FileAlreadyExistsException when report is generated (melloware)
Fixed: GITHUB-2825: Programically Loading TestNG Suite from JAR File Fails to Delete Temporary Copy of Suite File (Steven Jubb)
Fixed: GITHUB-2818: Add configuration key for callback discrepancy behavior (Krishnan Mahadevan)
Expand Down
2 changes: 1 addition & 1 deletion testng-core/src/main/java/org/testng/Converter.java
Expand Up @@ -65,7 +65,7 @@ private void run(String[] args) throws IOException {
if (file.endsWith(".xml")) {
File newFile = new File(m_outputDirectory, baseName + ".yaml");
writeFile(newFile, Yaml.toYaml(suite).toString());
} else if (file.endsWith(".yaml")) {
} else if (file.endsWith(".yaml") || file.endsWith(".yml")) {
File newFile = new File(m_outputDirectory, baseName + ".xml");
writeFile(newFile, suite.toXml());
} else {
Expand Down
Expand Up @@ -21,6 +21,7 @@ public XmlSuite parse(String filePath, InputStream is, boolean loadClasses)

@Override
public boolean accept(String fileName) {
return Parser.hasFileScheme(fileName) && fileName.endsWith(".yaml");
return Parser.hasFileScheme(fileName) && fileName.endsWith(".yaml")
|| fileName.endsWith(".yml");
speedythesnail marked this conversation as resolved.
Show resolved Hide resolved
}
}