-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test reports emitted by mocha-junit-reporter have <testcase> tags with slightly weird `name` and `classname` properties, e.g. <testsuite name="rest/defaults"> <testcase name="rest/defaults Init with given environment" classname="Init with given environment"> <testcase/> </testsuite> This looks a bit odd in the observability server web UI, which displays the testcase.name and testcase.classname properties. I don’t know whether it’d be better to do some pre-upload manipulation of the ably-js reports, or to change the fields displayed in the web UI. Not going to do anything about it now; it’s usable enough and I don’t want to mess up the display of the ably-cocoa test reports. Co-authored-by: Owen Pearson <[email protected]>
- Loading branch information
1 parent
1e46427
commit dd7c83e
Showing
14 changed files
with
13,151 additions
and
10,155 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ npm-debug.log | |
build/ | ||
react/ | ||
docs/generated/ | ||
junit/ | ||
test/support/mocha_junit_reporter/build/ |
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 +1,2 @@ | ||
test/common/ably-common/ | ||
test/support/mocha_junit_reporter/build/ |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const path = require('path'); | ||
|
||
module.exports = path.join(__dirname, '..', '..', 'junit'); |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const MochaJUnitReporter = require('mocha-junit-reporter'); | ||
module.exports = MochaJUnitReporter; |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
// mocha-junit-reporter calls this to check whether a report file already | ||
// exists (so it can delete it if so), so just return false since we’re not | ||
// going to write the report to the filesystem anyway | ||
existsSync: () => false, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const Mocha = require('mocha'); | ||
const MochaJUnitReporter = require('./mocha_junit_reporter/build/node'); | ||
const path = require('path'); | ||
const jUnitDirectoryPath = require('./junit_directory_path'); | ||
|
||
/** | ||
* Logs test results to the console (by extending the default `Spec` reporter) and also emits a JUnit XML file. | ||
*/ | ||
class Reporter extends Mocha.reporters.Spec { | ||
jUnitReporter; | ||
|
||
constructor(runner, options) { | ||
super(runner, options); | ||
const jUnitFileName = `node-${process.version.split('.')[0]}.junit`; | ||
const jUnitFilePath = path.join(jUnitDirectoryPath, jUnitFileName); | ||
this.jUnitReporter = new MochaJUnitReporter(runner, { reporterOptions: { mochaFile: jUnitFilePath } }); | ||
} | ||
} | ||
|
||
module.exports = Reporter; |
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
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