-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- removes the need for directoryHash - fixes bug with ci environment discovery that adds empty attributes - updates dependencies - updates the directoryHash function to work with different versions of node - fixes cli issues (not setting MONGO_URL correctly) - fixes issues with directoryHash functionality - check for the version on the server and alert the user to upgrade if the versions are different - fixes issue with git parsing all of the commit logs instead of the most recent - moves mongo operations to mongoose - uses express, simplifies server logic - fixes issue where 0/0 is NaN - make sure the git remotes are set correctly - does not allow analytics to be pushed without having a git remote setup - adds tests for node-coverage-cli - fixes the routes for getting coverage data - 300576f - updates main page to show current server version - gets data from the environment variables to check for any services running - be able to use node 4 for the node-coverage-cli - 93f35fb - adds loading interstitial view for all coverage pages - separates out some styles into style.css (coverage pages) - truncates commit message if it is too large - fixes the coverageFile page to show the correct percentage - fixes the coverageFile page to show the correct point in history - updates screenshots - fixes routes to be more generic - removes redundant code - uses git-url-parse to format the urls before being sent to the service - updates travis script - updates readme to have badge that points to coverage service - updates package.json to send coverage details to coverage service - we don't need build dependencies - remove support for node 4 - minor improvements - fixes coverage page using an incorrect interface for CoverageChart - fixes coverageFile page to have the same layout as the other coverage pages - updates screenshot - adds the error on the page to the error view in all coverage pages - uses the window location to generate the code snippet on the main page - updates screenshots - captures ci information - updates main page to show the correct way to get tap coverage - updates routes to accept ci data from cli
- Loading branch information
1 parent
c1c26f9
commit 840854a
Showing
68 changed files
with
2,506 additions
and
2,136 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
node_modules | ||
.DS_Store | ||
npm-debug.log | ||
package-lock.json |
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,2 +1 @@ | ||
import '@kadira/storybook/addons'; | ||
import '@kadira/storybook-addon-knobs/register' | ||
import '@storybook/addon-knobs/register' |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
module: { | ||
loaders: [{ | ||
rules: [{ | ||
test: /\.css$/, | ||
loaders: ['style-loader', 'css-loader'] | ||
}, | ||
|
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,4 @@ | ||
- [ ] show a pie chart of code types for a specific repo | ||
- [ ] add more storybook stories for the UI | ||
- [ ] jsdoc lib code | ||
- [ ] abstract coverage model into a class |
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,102 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const program = require('commander'); | ||
const http = require('http'); | ||
const https = require('https'); | ||
const fs = require('fs'); | ||
const url = require('url'); | ||
const updateNotifier = require('update-notifier'); | ||
|
||
const lcov = require('../lib/lcov'); | ||
const git = require('../lib/git'); | ||
const ci = require('../lib/ci'); | ||
|
||
const pkg = require('../package.json'); | ||
|
||
updateNotifier({pkg}).notify(); | ||
|
||
program | ||
.version(pkg.version) | ||
.option('-u, --url [db]', 'Set the url to upload lcov data too', 'http://localhost:8080') | ||
.parse(process.argv); | ||
|
||
const parsedUrl = url.parse(program.url); | ||
|
||
let input = ''; | ||
process.stdin.resume(); | ||
process.stdin.setEncoding('utf8'); | ||
process.stdin.on('data', (chunk) => { | ||
input += chunk; | ||
}); | ||
process.stdin.on('end', () => { | ||
const env = ci(); | ||
const output = { | ||
service_job_id: env.service_job_id, | ||
service_pull_request: env.service_pull_request, | ||
service_name: env.service_name, | ||
source_files: [], | ||
git: { | ||
git_commit: env.git_commit, | ||
git_branch: env.git_branch, | ||
git_committer_name: env.git_committer_name, | ||
git_committer_email: env.git_committer_email, | ||
git_message: env.git_message | ||
}, | ||
run_at: new Date() | ||
}; | ||
|
||
lcov.parse(input) | ||
.then((_lcov) => { | ||
// Go through and set the file contents | ||
for (let i = 0; i < _lcov.length; i++) { | ||
_lcov[i].source = fs.readFileSync(_lcov[i].file).toString('utf8'); | ||
_lcov[i].title = _lcov[i].file.substring(_lcov[i].file.lastIndexOf('/') + 1, _lcov[i].file.length); | ||
} | ||
output['source_files'] = _lcov; | ||
|
||
git.parse() | ||
.then(function(_git) { | ||
output['git'] = Object.assign(output['git'], _git); | ||
|
||
const options = { | ||
hostname: parsedUrl.hostname, | ||
port: parsedUrl.port || 80, | ||
path: '/api/v1/upload', | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
} | ||
}; | ||
let req, operation, data = ''; | ||
if(parsedUrl.protocol == 'https') { | ||
operation = https; | ||
} else { | ||
operation = http; | ||
} | ||
req = operation.request(options, (res) => { | ||
res.on('data', (chunk) => { | ||
data += chunk; | ||
}); | ||
res.on('end', () => { | ||
try { | ||
const response = JSON.parse(data); | ||
if(response.error) { | ||
console.error(response.error); // eslint-disable-line | ||
} else { | ||
console.log(`\n coverage sent successfully 💚 \n`); // eslint-disable-line | ||
} | ||
} catch(ex) { | ||
console.log(`\n uhoh something went wrong, ${ex.toString()}`); // eslint-disable-line | ||
} | ||
}); | ||
}); | ||
req.write(JSON.stringify(output)); | ||
req.end(); | ||
}) | ||
.catch((err) => { | ||
console.log(err); // eslint-disable-line | ||
}); | ||
}) | ||
.catch((err) => { throw err; } ); | ||
}); |
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,17 @@ | ||
#!/usr/bin/env node | ||
|
||
const program = require('commander'); | ||
const updateNotifier = require('update-notifier'); | ||
|
||
const pkg = require('../package.json'); | ||
|
||
updateNotifier({pkg}).notify(); | ||
|
||
program | ||
.version(pkg.version) | ||
.option('-d, --db [db]', 'Set the db connection', 'mongodb://localhost:32768/lcov-server') | ||
.parse(process.argv); | ||
|
||
process.env.MONGO_URL = process.env.MONGO_URL || program.db; | ||
|
||
require('../index'); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.