Skip to content

Commit

Permalink
update Test Infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
julkuh committed Jul 12, 2023
1 parent da98951 commit 2398ec7
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/support/js/check-licenses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
Checks licenses of node dependencies against a list of allowed licenses.
Fails with exit code != 0 and an error message if a disallowed license is encountered.
The script should be executed from the project root directory after dependencies have been installed:
$ ./node/node ./src/support/js/check-licenses.js
To run checks yourself (e.g. to update the allow list or to get details), install
license-checker yourself and run it from the project root directory:
$ npm install -g license-checker
$ license-checker --summary # outputs list of used licenses
$ license-checker --json # outputs details
See also https://www.npmjs.com/package/license-checker
*/

const checker = require("license-checker");
const process = require("process");

// Licenses known to be OK.
const ACCEPTED_LICENSES = [
"MIT",
"ISC",
"Apache-2.0",
"Apache 2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"BSD",
"CC0-1.0",
"CC-BY-3.0",
"CC-BY-4.0",
"Python-2.0",
"Unlicense" // Note: not unlicenseD (https://opensource.org/licenses/unlicense)
];

// Packages with licenses that are not recognized properly by license-checker.
// These must be checked manually.
const SKIP_PACKAGES = [
"event-stream@3.0.20", // MIT License not recognized
"taffydb@2.6.2" // BSD-1-Clause License in source code
];

checker.init(
{
start: process.cwd(),
onlyAllow: ACCEPTED_LICENSES.join(";"),
excludePackages: SKIP_PACKAGES.join(";")
},
(error, packages) => {
if (error) {
console.error("Error: ", error);
process.exit(1);
}
process.exit(0);
}
);
Binary file added src/test/webapp/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/test/webapp/js/tests/init-packs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2023 con terra GmbH (info@conterra.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
if (require.packs["@vue/test-utils"]) {
require.packs["@vue/test-utils"].main = "dist/vue-test-utils.umd";
}
if (require.packs["chai"]) {
require.packs["chai"].main = "chai";
}

0 comments on commit 2398ec7

Please sign in to comment.