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

Change dep of mocha-teamcity-reporter to be official release instead of cypress branch #4643

Merged
merged 5 commits into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions packages/server/__snapshots__/8_reporters_spec.coffee.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,3 +697,62 @@ Error: this reporter threw an error
Learn more at https://on.cypress.io/reporters

`

exports['e2e reporters supports teamcity reporter and reporter options 1'] = `

====================================================================================================

(Run Starting)

┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 1 found (simple_passing_spec.coffee) │
│ Searched: cypress/integration/simple_passing_spec.coffee │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

Running: simple_passing_spec.coffee... (1 of 1)
##teamcity[testSuiteStarted name='top suite' flowId='12345']
##teamcity[testSuiteStarted name='simple passing spec' flowId='12345']
##teamcity[testStarted name='passes' captureStandardOutput='true' flowId='12345']
##teamcity[testFinished name='passes' duration='XXXX' flowId='12345']
##teamcity[testSuiteFinished name='simple passing spec' duration='XXXX' flowId='12345']
##teamcity[testSuiteFinished name='top suite' duration='XXXX' flowId='12345']

(Results)

┌──────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true │
│ Duration: X seconds │
│ Spec Ran: simple_passing_spec.coffee │
└──────────────────────────────────────────┘


(Video)

- Started processing: Compressing to 32 CRF
- Finished processing: /foo/bar/.projects/e2e/cypress/videos/abc123.mp4 (X seconds)


====================================================================================================

(Run Finished)


Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ simple_passing_spec.coffee XX:XX 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
All specs passed! XX:XX 1 1 - - -


`
2 changes: 1 addition & 1 deletion packages/server/lib/reporter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ events = {
}

reporters = {
teamcity: "@cypress/mocha-teamcity-reporter"
teamcity: "mocha-teamcity-reporter"
junit: "mocha-junit-reporter"
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"@cypress/commit-info": "2.1.4",
"@cypress/get-windows-proxy": "1.5.4",
"@cypress/icons": "0.7.0",
"@cypress/mocha-teamcity-reporter": "1.0.0",
"@ffmpeg-installer/ffmpeg": "1.0.17",
"ansi_up": "1.3.0",
"bluebird": "3.4.7",
Expand Down Expand Up @@ -156,6 +155,7 @@
"minimist": "1.2.0",
"mocha": "2.4.5",
"mocha-junit-reporter": "1.23.0",
"mocha-teamcity-reporter": "3.0.0",
"moment": "2.24.0",
"morgan": "1.9.1",
"node-machine-id": "1.1.10",
Expand Down
9 changes: 9 additions & 0 deletions packages/server/test/e2e/8_reporters_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ describe "e2e reporters", ->
expect(json.stats).to.be.an('object')
expect(json.stats.failures).to.eq(0)
expect(json.stats.other).to.eq(3)

it "supports teamcity reporter and reporter options", ->
e2e.exec(@, {
spec: "simple_passing_spec.coffee"
expectedExitCode: 0
snapshot: true
reporter: "teamcity"
reporterOptions: "topLevelSuite=top suite,flowId=12345,useStdError='true',useStdError='true',recordHookFailures='true',actualVsExpected='true'"
})
6 changes: 6 additions & 0 deletions packages/server/test/support/helpers/e2e.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ replaceDurationSeconds = (str, p1, p2, p3, p4) ->

p1 + _.padEnd("X seconds", lengthOfExistingDuration)

replaceDurationFromReporter = (str, p1, p2, p3) ->
## duration='1589'

p1 + _.padEnd("X", p2.length, "X") + p3

replaceDurationInTables = (str, p1, p2) ->
## when swapping out the duration, ensure we pad the
## full length of the duration so it doesn't shift content
Expand Down Expand Up @@ -82,6 +87,7 @@ normalizeStdout = (str) ->
.replace(/(.+)(\/.+\.mp4)/g, "$1/abc123.mp4") ## replace dynamic video names
.replace(/(Cypress\:\s+)(\d\.\d\.\d)/g, "$1" + "1.2.3") ## replace Cypress: 2.1.0
.replace(/(Duration\:\s+)(\d+\sminutes?,\s+)?(\d+\sseconds?)(\s+)/g, replaceDurationSeconds)
.replace(/(duration\=\')(\d+)(\')/g, replaceDurationFromReporter) ## replace duration='1589'
.replace(/\((\d+ minutes?,\s+)?\d+ seconds?\)/g, "(X seconds)")
.replace(/\r/g, "")
.replace(/(Uploading Results.*?\n\n)((.*-.*[\s\S\r]){2,}?)(\n\n)/g, replaceUploadingResults) ## replaces multiple lines of uploading results (since order not guaranteed)
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/unit/reporter_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe "lib/reporter", ->
context ".create", ->
it "can create mocha-teamcity-reporter", ->
teamCityFn = sinon.stub()
mockery.registerMock("@cypress/mocha-teamcity-reporter", teamCityFn)
mockery.registerMock("mocha-teamcity-reporter", teamCityFn)

reporter = Reporter.create("teamcity")
reporter.setRunnables(@root)
Expand Down