6.6.9 • Published 6 years ago

sendemailssss v6.6.9

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

A simple email notifier wrotten in Rx-js

  • Will send email to people whose case fails
  • Usage:
npm install -g sendemailsss
# Send email
sss http://jenkins.lab.rcch.ringcentral.com/view/mThor-TA/view/DevicePool-Android-Daily/job/mThor-Android-Device-Pool-Collection-DailyCI/57/artifact/report/reportForAnaylze.txt
# Print the report with pretty format
ssv http://jenkins.lab.rcch.ringcentral.com/view/mThor-TA/view/DevicePool-Android-Daily/job/mThor-Android-Device-Pool-Collection-DailyCI/57/artifact/report/reportForAnaylze.txt

How it works

  1. Anaylze for reportForAnaylze.txt, for example: http://jenkins.lab.rcch.ringcentral.com/view/mThor-TA/view/DevicePool-iOS-Daily/job/mThor-IOS-Device-Pool-Collection-DailyCI-All/lastSuccessfulBuild/artifact/report/reportForAnaylze.txt
    ---New Issue
    MTR-1026,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30077-MTR-1026-feature.html
    MTR-1027,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30078-MTR-1027-feature.html
    MTR-1034,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P0-RealDevice-Device-Pool/cucumber-html-reports/299/report-feature_features-30130-MTR-1034-feature.html
    MTR-1035,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30131-MTR-1035-feature.html
    MTR-1037,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30133-MTR-1037-feature.html
    MTR-1038,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P0-RealDevice-Device-Pool/cucumber-html-reports/299/report-feature_features-30134-MTR-1038-feature.html
    MTR-104,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-MTR-104-feature.html
    MTR-1040,FAIL,NewIssue steps[10]:errorMessage:step error message is: java.lang.AssertionError: expected [false] but found [true]	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P0-RealDevice-Device-Pool/cucumber-html-reports/299/report-feature_features-30136-MTR-1040-feature.html
    MTR-1053,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed	http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30137-MTR-1053-feature.html
  2. Get all the failed cases, and their link. For example, From MTR-1053,FAIL,NewIssue before[1]:errorMessage:step error message is: org.openqa.selenium.WebDriverException: create driver failed http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30137-MTR-1053-feature.html we will use regex to get report url for MTR-1053: http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30137-MTR-1053-feature.html

  3. Get the content of http://ci-repository.lab.rcch.ringcentral.com/mThor-ios-HB-Daily-P1-RealDevice-Device-Pool/cucumber-html-reports/260/report-feature_features-30137-MTR-1053-feature.html, to see whether the author is in it. Will load all authors from app/config.js. For example, From this cucumber report, we can find this case belongs to sherry.npm.io

  4. Collect all the results, send email to them.

Project structure

app
├── index.js # Entry point
├── anylazeAndPrint.js # ssv logic
├── config.js # Author config
├── fetchCases.js # Fetch cases from reportForAnalyze.txt
├── getOwners.js # Get owners from cucumber report
└── sendEmail.js # Send emails to owners

Why you can use sss and ssv in command line? npm install -g will install the bin in package.json to usr/local/bin, like below:

➜  sendEmail git:(master) ✗ ls -l /usr/local/bin | grep ssv
lrwxr-xr-x  1 elton.zhong  admin               43 Nov 29 11:02 ssv -> ../lib/node_modules/sendemailsss/bin/ssv.js

you should specify bin script pathes in the package.json:

  "bin": {
    "sss": "./bin/sss.js",
    "ssv": "./bin/ssv.js"
  },

And the bin/ssv.js will be the entry point.