-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
577 additions
and
15 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
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
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
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
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
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,10 @@ | ||
packages: | ||
- name: lib | ||
type: yarn | ||
srcs: | ||
- mochaw.sh | ||
- package.json | ||
config: | ||
packaging: library | ||
yarnLock: ${coreYarnLockBase}/yarn.lock | ||
dontTest: true |
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,35 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024 Gitpod GmbH. All rights reserved. | ||
# Licensed under the GNU Affero General Public License (AGPL). | ||
# See License.AGPL.txt in the project root for license information. | ||
|
||
|
||
COMPONENT_DIR="$(pwd)" | ||
|
||
# unit or db | ||
TEST_SUITE=${1:-unit} | ||
|
||
FILE_PATTERN="**/*.spec.js" | ||
if [ "$TEST_SUITE" = "db" ]; then | ||
FILE_PATTERN="**/*.spec.db.js" | ||
fi | ||
|
||
# Exclude the first argument and pass the rest to mocha | ||
shift 1 | ||
|
||
if [ "$COVERAGE" = "true" ]; then | ||
nyc --cwd=/workspace/gitpod \ | ||
--all \ | ||
--report-dir="$COMPONENT_DIR/coverage/$TEST_SUITE" \ | ||
--include="components/*/{src,lib,dist}/**/*.{ts,js}" \ | ||
--include="components/public-api/typescript-common/src/**/*.ts" \ | ||
--exclude="components/**/*.spec.{ts,js}" \ | ||
--exclude="components/**/*.spec.db.{ts,js}" \ | ||
--exclude="components/*/src/test/**" \ | ||
--exclude="components/dashboard/**" \ | ||
--exclude="components/supervisor/frontend/**" \ | ||
--reporter=json \ | ||
mocha "$COMPONENT_DIR/$FILE_PATTERN" --exclude "$COMPONENT_DIR/node_modules/**" --exclude "$COMPONENT_DIR/lib/esm/**" --exit "$@" | ||
else | ||
mocha "$COMPONENT_DIR/$FILE_PATTERN" --exclude "$COMPONENT_DIR/node_modules/**" --exclude "$COMPONENT_DIR/lib/esm/**" --exit "$@" | ||
fi |
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 @@ | ||
{ | ||
"name": "@gitpod/mochaw", | ||
"version": "0.1.5", | ||
"license": "UNLICENSED", | ||
"files": [ | ||
"mochaw.sh" | ||
], | ||
"bin": { | ||
"mochaw": "mochaw.sh" | ||
}, | ||
"scripts": { | ||
"build": "echo 'nothing to build'" | ||
}, | ||
"dependencies": { | ||
"nyc": "^15.1.0" | ||
} | ||
} |
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,45 @@ | ||
#!/bin/bash | ||
|
||
export COVERAGE=true | ||
|
||
yarn --cwd=/workspace/gitpod install | ||
rm -rf coverage | ||
|
||
# gitpod-protocol | ||
rm -rf /workspace/gitpod/components/gitpod-protocol/coverage | ||
yarn --cwd=/workspace/gitpod/components/gitpod-protocol run test:leeway | ||
yarn nyc merge --cwd=/workspace/gitpod components/gitpod-protocol/coverage/unit coverage/gitpod-protocol-unit.json | ||
|
||
# gitpod-db | ||
rm -rf /workspace/gitpod/components/gitpod-db/coverage | ||
yarn --cwd=/workspace/gitpod/components/gitpod-db run build | ||
yarn --cwd=/workspace/gitpod/components/gitpod-db run test | ||
yarn nyc merge --cwd=/workspace/gitpod components/gitpod-db/coverage/db coverage/gitpod-db-db.json | ||
|
||
# public-api-common | ||
rm -rf /workspace/gitpod/components/public-api/typescript-common/coverage | ||
yarn --cwd=/workspace/gitpod/components/public-api/typescript-common run test:leeway | ||
yarn nyc merge --cwd=/workspace/gitpod components/public-api/typescript-common/coverage/unit coverage/public-api-common-unit.json | ||
|
||
# server | ||
rm -rf /workspace/gitpod/components/server/coverage | ||
yarn --cwd=/workspace/gitpod/components/server run build | ||
yarn --cwd=/workspace/gitpod/components/server run test | ||
yarn nyc merge --cwd=/workspace/gitpod components/server/coverage/unit coverage/server-unit.json | ||
yarn nyc merge --cwd=/workspace/gitpod components/server/coverage/db coverage/server-db.json | ||
|
||
# ws-manager-api | ||
rm -rf /workspace/gitpod/components/ws-manager-api/typescript/coverage | ||
yarn --cwd=/workspace/gitpod/components/ws-manager-api/typescript run build | ||
yarn --cwd=/workspace/gitpod/components/ws-manager-api/typescript run test | ||
yarn nyc merge --cwd=/workspace/gitpod components/ws-manager-api/typescript/coverage/unit coverage/ws-manager-api-unit.json | ||
|
||
# ws-manager-bridge | ||
rm -rf /workspace/gitpod/components/ws-manager-bridge/coverage | ||
yarn --cwd=/workspace/gitpod/components/ws-manager-bridge run build | ||
yarn --cwd=/workspace/gitpod/components/ws-manager-bridge run test | ||
yarn nyc merge --cwd=/workspace/gitpod components/ws-manager-bridge/coverage/unit coverage/ws-manager-bridge-unit.json | ||
|
||
# final | ||
yarn nyc merge --cwd=/workspace/gitpod coverage coverage/final-coverage.json | ||
yarn nyc report --cwd=/workspace/gitpod --reporter=lcov --reporter=text-summary --temp-dir=coverage |
Oops, something went wrong.