remove coverage unused

This commit is contained in:
Audric Ackermann 2021-07-05 10:26:40 +10:00
parent 6ca466cc22
commit ca331b95a6
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
13 changed files with 34 additions and 168 deletions

View File

@ -1,6 +1,5 @@
build/**
components/**
coverage/**
dist/**
mnemonic_languages/**

2
.gitignore vendored
View File

@ -1,7 +1,6 @@
node_modules
.sass-cache
.eslintcache
coverage/*
build/curve25519_compiled.js
build/icons/*
stylesheets/*.css.map
@ -12,7 +11,6 @@ config/local-*.json
*.provisionprofile
release/
/dev-app-update.yml
.nyc_output/
*.sublime*
sql/

View File

@ -47,6 +47,4 @@ test/fixtures.js
stylesheets/_intlTelInput.scss
# Coverage
coverage/**
.nyc_output/**
release/**

View File

@ -14,10 +14,6 @@ assets
# examples
example
# code coverage directories
coverage
.nyc_output
# build scripts
Makefile
Gulpfile.js
@ -38,5 +34,3 @@ Gruntfile.js
# misc
*.md
# asset directories
!nyc/node_modules/istanbul-reports/lib/html/assets

View File

@ -20,18 +20,17 @@
"start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=$MULTI electron .",
"grunt": "grunt",
"grunt:dev": "yarn clean-transpile; yarn grunt dev --force",
"icon-gen": "electron-icon-maker --input=images/session/session_icon_1024.png --output=./build",
"icon-gen": "cp images/session/session_icon_1024.png --output=./build/icon.png",
"generate": "yarn icon-gen && yarn grunt --force",
"build-release": "cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release",
"build-module-protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
"clean-module-protobuf": "rm -f ts/protobuf/compiled.d.ts ts/protobuf/compiled.js",
"clean-module-protobuf": "rimraf ts/protobuf/compiled.d.ts ts/protobuf/compiled.js",
"build-protobuf": "yarn build-module-protobuf",
"clean-protobuf": "yarn clean-module-protobuf",
"test": "yarn test-node && yarn test-electron",
"test-view": "NODE_ENV=test yarn run start",
"test-lib-view": "NODE_ENV=test-lib yarn run start",
"test-electron": "yarn grunt test",
"test-integration": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --full-trace --timeout 10000 ts/test/session/integration/integration_itest.js",
"test-node": "mocha --recursive --exit --timeout 10000 test/app test/modules \"./ts/test/**/*_test.js\" ",
"eslint-full": "eslint .",
"lint-full": "yarn format-full && yarn lint-files-full",
@ -181,7 +180,6 @@
"eslint-plugin-import": "2.8.0",
"eslint-plugin-mocha": "4.12.1",
"eslint-plugin-more": "0.3.1",
"extract-zip": "1.6.6",
"grunt": "1.0.1",
"grunt-cli": "1.2.0",
"grunt-contrib-concat": "1.0.1",
@ -196,12 +194,9 @@
"mocha-testcheck": "1.0.0-rc.0",
"node-gyp": "3.8.0",
"node-sass-import-once": "1.2.0",
"nyc": "11.4.1",
"postinstall-prepare": "^1.0.1",
"prettier": "1.19.0",
"qs": "6.5.1",
"react-docgen-typescript": "1.2.6",
"react-styleguidist": "7.0.1",
"sinon": "9.0.2",
"spectron": "^10.0.0",
"ts-loader": "4.1.0",
@ -322,7 +317,7 @@
"!**/node_modules/*/build/**",
"!**/*.{o,hprof,orig,pyc,pyo,rbc}",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.editorconfig,.flowconfig,.yarn-metadata.json,.idea,appveyor.yml,.travis.yml,circle.yml,npm-debug.log,.nyc_output,yarn.lock,.yarn-integrity,.map}",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.editorconfig,.flowconfig,.yarn-metadata.json,.idea,appveyor.yml,.travis.yml,circle.yml,npm-debug.log,,yarn.lock,.yarn-integrity,.map}",
"node_modules/spellchecker/build/Release/*.node",
"node_modules/websocket/build/Release/*.node",
"node_modules/socks/build/*.js",

View File

@ -1,78 +0,0 @@
const path = require('path');
// eslint-disable-next-line import/no-extraneous-dependencies
const typescriptSupport = require('react-docgen-typescript');
const propsParser = typescriptSupport.withCustomConfig('./tsconfig.json').parse;
module.exports = {
sections: [
{
name: 'Components',
description: '',
components: 'ts/components/[^_]*.tsx',
},
{
name: 'Conversation',
description: 'Everything necessary to render a conversation',
components: 'ts/components/conversation/[^_]*.tsx',
},
{
name: 'Media Gallery',
description: 'Display media and documents in a conversation',
components: 'ts/components/conversation/media-gallery/[^_]*.tsx',
},
{
name: 'Utility',
description: 'Utility components used across the application',
components: 'ts/components/utility/[^_]*.tsx',
},
{
name: 'Test',
description: 'Components only used for testing',
components: 'ts/styleguide/**/*.tsx',
},
],
contextDependencies: [path.join(__dirname, 'ts/styleguide')],
// We don't want one long, single page
pagePerSection: true,
// Expose entire repository to the styleguidist server, primarily for stylesheets
assetsDir: './',
// Add top-level elements to the HTML:
// docs: https://github.com/vxna/mini-html-webpack-template
// https://react-styleguidist.js.org/docs/configuration.html#template
template: {
head: {
links: [
{
rel: 'stylesheet',
type: 'text/css',
href: '/stylesheets/manifest.css',
},
],
},
},
propsParser,
webpackConfig: {
devtool: 'source-map',
resolve: {
// Necessary to enable the absolute path used in the context option above
modules: [__dirname, path.join(__dirname, 'node_modules')],
extensions: ['.tsx'],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
},
{
// To test handling of attachments, we need arraybuffers in memory
test: /\.(gif|mp3|mp4|txt|jpg|jpeg|png)$/,
loader: 'arraybuffer-loader',
},
],
},
},
};

View File

@ -61,11 +61,6 @@
<script type="text/javascript" src="fixtures.js"></script>
<script type="text/javascript" src="fixtures_test.js"></script>
<!-- Comment out to turn off code coverage. Useful for getting real callstacks. -->
<!-- NOTE: blanket doesn't support modern syntax and will choke until we find a replacement. :0( -->
<!-- <script type="text/javascript" src="blanket_mocha.js"></script> -->
<!-- Uncomment to start tests without code coverage enabled -->
<script type="text/javascript">
mocha.run();
</script>

View File

@ -177,7 +177,7 @@ export const sendViaOnion = async (
});
},
{
retries: 9, // each path can fail 3 times before being dropped, we have 3 paths at most
retries: 4, // each path can fail 3 times before being dropped, we have 3 paths at most
factor: 2,
minTimeout: 100,
maxTimeout: 4000,

View File

@ -542,7 +542,7 @@ export async function retrieveNextMessages(
} catch (e) {
window?.log?.warn(
'Got an error while retrieving next messages. Not retrying as we trigger fetch often:',
e
e.message
);
if (e.message === ERROR_CODE_NO_CONNECT) {
window.inboxStore?.dispatch(updateIsOnline(false));

View File

@ -402,6 +402,7 @@ export async function decodeOnionResult(symmetricKey: ArrayBuffer, ciphertext: s
return { plaintext: new TextDecoder().decode(plaintextBuffer), ciphertextBuffer };
}
const STATUS_NO_STATUS = 8888;
/**
* Only exported for testing purpose
*/
@ -413,8 +414,8 @@ export async function processOnionResponse({
associatedWith,
lsrpcEd25519Key,
}: {
response: { text: () => Promise<string>; status: number };
symmetricKey: ArrayBuffer;
response?: { text: () => Promise<string>; status: number };
symmetricKey?: ArrayBuffer;
guardNode: Snode;
lsrpcEd25519Key?: string;
abortSignal?: AbortSignal;
@ -425,13 +426,13 @@ export async function processOnionResponse({
processAbortedRequest(abortSignal);
try {
ciphertext = await response.text();
ciphertext = (await response?.text()) || '';
} catch (e) {
window?.log?.warn(e);
}
await processOnionRequestErrorOnPath(
response.status,
response?.status || STATUS_NO_STATUS,
ciphertext,
guardNode.pubkey_ed25519,
lsrpcEd25519Key,
@ -455,10 +456,12 @@ export async function processOnionResponse({
ciphertextBuffer = decoded.ciphertextBuffer;
} catch (e) {
window?.log?.error('[path] lokiRpc::processingOnionResponse - decode error', e);
window?.log?.error(
'[path] lokiRpc::processingOnionResponse - symmetricKey',
toHex(symmetricKey)
);
if (symmetricKey) {
window?.log?.error(
'[path] lokiRpc::processingOnionResponse - symmetricKey',
toHex(symmetricKey)
);
}
if (ciphertextBuffer) {
window?.log?.error(
'[path] lokiRpc::processingOnionResponse - ciphertextBuffer',
@ -666,13 +669,22 @@ const sendOnionRequestHandlingSnodeEject = async ({
}): Promise<SnodeResponse> => {
// this sendOnionRequest() call has to be the only one like this.
// If you need to call it, call it through sendOnionRequestHandlingSnodeEject because this is the one handling path rebuilding and known errors
const { response, decodingSymmetricKey } = await sendOnionRequest({
nodePath,
destX25519Any,
finalDestOptions,
finalRelayOptions,
abortSignal,
});
let response, decodingSymmetricKey;
try {
// this might throw a timeout error
const result = await sendOnionRequest({
nodePath,
destX25519Any,
finalDestOptions,
finalRelayOptions,
abortSignal,
});
response = result.response;
decodingSymmetricKey = result.decodingSymmetricKey;
} catch (e) {
window.log.warn('sendOnionRequest', e);
}
// this call will handle the common onion failure logic.
// if an error is not retryable a AbortError is triggered, which is handled by pRetry and retries are stopped
const processed = await processOnionResponse({
@ -877,7 +889,7 @@ export async function lokiOnionFetch(
return retriedResult;
} catch (e) {
window?.log?.warn('onionFetchRetryable failed ', e);
window?.log?.warn('onionFetchRetryable failed ', e.message);
// console.warn('error to show to user');
if (e?.errno === 'ENETUNREACH') {
// better handle the no connection state

View File

@ -128,7 +128,6 @@ const excludedFiles = [
'^node_modules/node-sass-import-once/*',
'^node_modules/node-sass/*',
'^node_modules/nsp/*',
'^node_modules/nyc/*',
'^node_modules/phantomjs-prebuilt/*',
'^node_modules/postcss*',
'^node_modules/preserve/*',
@ -137,7 +136,6 @@ const excludedFiles = [
'^node_modules/ramda/*',
'^node_modules/react-docgen/*',
'^node_modules/react-error-overlay/*',
'^node_modules/react-styleguidist/*',
'^node_modules/recast/*',
'^node_modules/reduce-css-calc/*',
'^node_modules/resolve/*',

View File

@ -114,51 +114,6 @@
"expression": "\\bload\\(",
"reason": "Arbitrary code execution"
},
{
"name": "React-ref",
"expression": "\\bref(\\s)*=\\b",
"reason": "Potential XSS",
"excludedModules": [
"node_modules/react-dom",
"node_modules/tslint-microsoft-contrib",
"node_modules/react-error-overlay",
"node_modules/react-styleguidist"
]
},
{
"name": "React-createRef",
"expression": "\\bcreateRef\\(",
"reason": "Potential XSS",
"excludedModules": [
"node_modules/react/",
"node_modules/react-dom",
"node_modules/tslint-microsoft-contrib",
"node_modules/react-error-overlay",
"node_modules/react-styleguidist"
]
},
{
"name": "React-findDOMNode",
"expression": "\\bfindDOMNode\\(",
"reason": "Potential XSS",
"excludedModules": [
"node_modules/react-dom",
"node_modules/tslint-microsoft-contrib",
"node_modules/react-error-overlay",
"node_modules/react-styleguidist"
]
},
{
"name": "React-dangerouslySetInnerHTML",
"expression": "\\bdangerouslySetInnerHTML\\b",
"reason": "Potential XSS",
"excludedModules": [
"node_modules/react-dom",
"node_modules/tslint-microsoft-contrib",
"node_modules/react-error-overlay",
"node_modules/react-styleguidist"
]
},
{
"name": "fbjs-createNodesFromMarkup",
"expression": "\\bcreateNodesFromMarkup\\b",

View File

@ -73,7 +73,7 @@
}
],
// Adding select dev dependencies here for now, may turn on all in the future
"no-implicit-dependencies": [true, ["dashdash", "electron"]],
"no-implicit-dependencies": [true, ["electron"]],
// Maybe will turn on:
// We're not trying to be comprehensive with JSDoc right now. We have the style guide.
"completed-docs": false,