Skip to content

Commit

Permalink
feat(test-tooling): all in one besu ledger
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed May 19, 2020
1 parent 5782eb8 commit 4ba6f4b
Show file tree
Hide file tree
Showing 17 changed files with 803 additions and 130 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ examples/simple-asset-transfer/fabric/**/hfc-key-store/
bin/
.tmp/
lerna-debug.log
bif-openapi-spec.json
26 changes: 22 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
"scripts": {
"configure": "lerna clean --yes && lerna bootstrap && npm run build && node ./tools/generate-api-server-config.js",
"start:api-server": "node ./packages/bif-cmd-api-server/dist/lib/main/typescript/cmd/bif-api.js --config-file=.config.json",
"generate-sdk": "openapi-generator generate -i x.json -g typescript-axios -o packages/bif-sdk/src/main/typescript/generated/openapi/typescript-axios/",
"pregenerate-sdk": "ts-node -e 'import(\"./packages/bif-cmd-api-server/src/main/typescript/openapi-spec\").then((x) => x.exportToFileSystemAsJson());'",
"generate-sdk": "openapi-generator generate --input-spec bif-openapi-spec.json -g typescript-axios -o packages/bif-sdk/src/main/typescript/generated/openapi/typescript-axios/",
"tsc": "lerna exec --stream --ignore '*/*cockpit' -- tsc --project ./tsconfig.json",
"clean": "lerna exec --stream --ignore '*/*cockpit' -- del-cli dist/** && del-cli packages/bif-sdk/src/main/typescript/generated/openapi/typescript-axios/*",
"build": "npm-run-all build:backend build:frontend",
"build:frontend": "lerna exec --stream --scope '*/*cockpit' -- ng build --prod",
"build:backend": "npm-run-all lint clean generate-sdk tsc webpack",
"build:dev:pkg:cmd-api-server": "lerna exec --stream --scope '*/*api-server' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"build:dev:pkg:test-tooling": "lerna exec --stream --scope '*/*test-tooling' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"build:dev:pkg:sdk": "lerna exec --stream --scope '*/*sdk' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"webpack": "npm-run-all webpack:web:dev webpack:node:dev webpack:web:prod webpack:node:prod",
"webpack:web:prod": "lerna exec --stream --ignore '*/*{cockpit,server}' -- webpack --env=prod --target=web --config ../../webpack.config.js",
"webpack:web:dev": "lerna exec --stream --ignore '*/*{cockpit,server}' -- webpack --env=dev --target=web --config ../../webpack.config.js",
"webpack:web:prod": "lerna exec --stream --ignore '*/*{cockpit,server,test-tooling}' -- webpack --env=prod --target=web --config ../../webpack.config.js",
"webpack:web:dev": "lerna exec --stream --ignore '*/*{cockpit,server,test-tooling}' -- webpack --env=dev --target=web --config ../../webpack.config.js",
"webpack:node:prod": "lerna exec --stream --ignore '*/*cockpit' -- webpack --env=prod --target=node --config ../../webpack.config.js",
"webpack:node:dev": "lerna exec --stream --ignore '*/*cockpit' -- webpack --env=dev --target=node --config ../../webpack.config.js",
"changelog": "conventional-changelog --infile CHANGELOG.md --outfile CHANGELOG.md && git add CHANGELOG.md",
Expand All @@ -23,6 +25,7 @@
"lint": "lerna exec --stream --ignore '*/*cockpit' -- cross-env DEBUG= tslint --project tsconfig.json",
"pretest": "npm run build",
"test": "lerna exec --stream --ignore '*/*cockpit' -- tap --timeout=600 src/test/typescript/unit/",
"test:bif-test-tooling": "lerna exec --stream --scope '*/*test-tooling' -- tap --timeout=600 src/test/typescript/integration/",
"test-coverage": "lerna exec --stream --ignore '*/*cockpit' -- tap --timeout=600 src/test/typescript/unit/ --cov",
"test-coverage-html": "lerna exec --stream --ignore '*/*cockpit' -- tap --timeout=600 src/test/typescript/unit/ --cov --coverage-report=lcov",
"test-integration": "lerna exec --stream --ignore '*/*cockpit' -- tap --timeout=600 src/test/typescript/integration/",
Expand Down Expand Up @@ -51,6 +54,7 @@
"source-map-loader": "0.2.4",
"tap": "14.10.6",
"ts-loader": "6.2.1",
"ts-node": "8.9.1",
"tslint": "6.0.0",
"typescript": "3.7.5",
"webpack": "4.41.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,12 @@ export const BIF_OPEN_API_JSON: OpenAPI.OpenAPIV3.Document = {
}
}
};

export async function exportToFileSystemAsJson(): Promise<void> {
const fs = await import('fs');
const destination = process.argv[2] || './bif-openapi-spec.json';

// tslint:disable-next-line: no-console
console.log(`OpenApiSpec#exportToFileSystemAsJson() destination=${destination}`);
fs.writeFileSync(destination, JSON.stringify(BIF_OPEN_API_JSON, null, 4));
};
9 changes: 9 additions & 0 deletions packages/bif-test-tooling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# `@hyperledger-labs/bif-test-tooling`

> TODO: description
## Usage

```
// TODO: DEMONSTRATE API
```
Loading

0 comments on commit 4ba6f4b

Please sign in to comment.