-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented unit test in build (#30)
* Updated jest dependencies. Removed jest dependencies from root package.json. Moved jest-config to extentensions/crossmodel-lang for now. * Enabled test in the pipeline. * Added github specific reporting option for jest. * Fixed error with not seeing debug messages in debug mode. * Updated package.json files to all have test script and use lerna to run all tests. * Refactored build workflows and actions to use bash i.s.o. PowerShell and aligned with Theia Blueprint. * Removed setting yarn version. * Added matrix for feature branch to test multiple OSes. * Updated main workflow to also include the matrix, like the feature workflow. * Added publishing of test results. * Added jest-junit and configured jest to report the junit xml. Updated workflow to pickup the jest xml. * Fixed error in publish test result. * another try with different test path * Refactored test result reporting into seperate job. * Changed path for upload artifacts. * Refactored workflows from actions to subworkflow. * Added missing type on workflow inputs * Changed required on inputs to false. * Refactored use of inputs to env variables for software versions. Changed jest config to write in the root, i.s.o. out directory. Changed scan path for publishing test results. * Fixed error with environment variable. * Fixed folder naming issue. * Excluded plugin folders in publish of test results. Updated publish test result files path. * Updated tsconfig to be in line with Theia and solve warning. Performed yarn upgrade. * Updated upload-artifacts for excluding plugin folders. * Updated jest config to work for alle applications, extensions and packages. * Fixed jest root level configuration and vscode settings. Remove coverage report. * Also skip the node_modules folder for uploading test results. * Added skipping node_modules in jest base config. * Removed coverage files and added to gitignore. * Added jest to tslint configuration Refactored tsconfig to all extend the base tsconfig and have specific one in the root of the workspace. * Setup gitpod config. * Setup devcontainer config. * Updated eslintrc ignore patterns. * Updated eslint include path config. * Added lint to github build-and-test workflow. * Updated Jest launch and settings to test debugging works in VS Code. Added model-server test from another branch. * Moved setting jest reports to workspace level. pdated package.json in root to execute jest directly, i.s.o. via lerna per package. * Updated model-server unit tests, to test on error code, i.s.o. path (which is OS dependent). * Updated uploading test results. * Set theia version explicitly to 1.37.2. * Fixed lint error in no return type.
- Loading branch information
Showing
53 changed files
with
3,081 additions
and
3,883 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Dev-Container for CrossModel. | ||
// For format details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "Node.js & TypeScript", | ||
// https://github.com/devcontainers/templates/tree/main/src/typescript-node | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-16-bullseye", | ||
"features": { | ||
"ghcr.io/devcontainers/features/python:1": { | ||
"version": "3.11.4" | ||
} | ||
}, | ||
|
||
// Allow port 3000 to be forwarded. | ||
"forwardPorts": [3000], | ||
|
||
// Install the needed OS libs for building. | ||
"postCreateCommand": "sudo apt-get update && sudo apt-get -y install libsecret-1-dev libxkbfile-dev" | ||
} |
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,19 +1,15 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'./configs/base.eslintrc.js', | ||
'./configs/warnings.eslintrc.js', | ||
'./configs/errors.eslintrc.js' | ||
], | ||
extends: ['./configs/base.eslintrc.js', './configs/warnings.eslintrc.js', './configs/errors.eslintrc.js'], | ||
ignorePatterns: ['**/{node_modules,lib}', '**/.eslintrc.js', 'extensions/**/generated'], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: 'tsconfig.eslint.json' | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
react: { | ||
version: 'detect' | ||
} | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,88 @@ | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
NODE_VERSION: 16.20.0 | ||
PYTHON_VERSION: 3.11.4 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build-and-test: | ||
name: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-2019, ubuntu-latest, macos-11] | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
# Checkout the code. | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Setup Node | ||
- name: Setup Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
# Setup Python | ||
- name: Setup Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
# Build the code. | ||
- name: Build | ||
# We set a timeout here as a fix for the timeout issues which sometimes occur when connecting the the npm repo. | ||
run: | | ||
yarn --skip-integrity-check --network-timeout 100000 | ||
yarn build | ||
# Execute the tests. | ||
- name: Test | ||
run: yarn test | ||
env: | ||
# The test result file name can be controlled using the following environment variable. | ||
JEST_JUNIT_OUTPUT_NAME: unit-test-results-${{ runner.os }}.xml | ||
|
||
# Upload Test Results (The different files for the OSes will end up in the same artifact). | ||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: unit-test-tesults | ||
# Include the unit-test-results folders (which is in the root of the workspace). | ||
path: unit-test-results | ||
|
||
# Run lint only on Linux (since it only makes sense to run it once, and linux is the fastest). | ||
- name: Lint | ||
if: runner.os == 'Linux' | ||
run: yarn lint | ||
|
||
# Publish a test report using the test result files published in the previous step (executed per OS). | ||
publish-test-report: | ||
name: Publish Test Report | ||
needs: build-and-test | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
# Download the test results artifacts. | ||
- name: Download Test Results | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: unit-test-tesults | ||
path: unit-test-tesults | ||
# Publish Test Results | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
check_name: Test Results | ||
files: | | ||
unit-test-tesults/**/*.xml |
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,13 @@ | ||
name: cicd-feature | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature/* | ||
pull_request: | ||
branches: | ||
- feature/* | ||
|
||
jobs: | ||
build-and-test: | ||
uses: ./.github/workflows/build-and-test.yml |
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 @@ | ||
name: cicd-main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-test: | ||
uses: ./.github/workflows/build-and-test.yml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -13,4 +13,6 @@ plugins | |
bin | ||
.ignored_out | ||
dist | ||
*.port | ||
*.port | ||
**/unit-test-results | ||
**/coverage |
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,17 +1,15 @@ | ||
# This configuration file was automatically generated by Gitpod. | ||
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) | ||
# and commit this file to your remote git repository to share the goodness with others. | ||
|
||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart | ||
|
||
# To have the dependencies for Theia installed execute the following commands in the GitPod workspace once: | ||
# sudo apt-get install libsecret-1-dev libxkbfile-dev | ||
# nvm install 16.20.0 | ||
# pyenv install -s 3.11.4 | ||
# pyenv global 3.11.4 | ||
# GitPod configuration for CrossModel. | ||
|
||
tasks: | ||
- init: yarn install && yarn run build | ||
command: yarn run watch | ||
# To have the OS dependencies for CrossModel installed execute the following commands in the GitPod workspace once: | ||
- before: | | ||
sudo apt-get -y install libsecret-1-dev libxkbfile-dev | ||
nvm install 16.20.0 | ||
pyenv install -s 3.11.4 | ||
pyenv global 3.11.4 | ||
# Download dependencies | ||
init: yarn | ||
# Build and watch the source code. | ||
command: yarn watch | ||
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,5 @@ | ||
const baseConfig = require('../../configs/base.jest.config'); | ||
|
||
module.exports = { | ||
...baseConfig | ||
}; |
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,5 @@ | ||
const baseConfig = require('../../configs/base.jest.config'); | ||
|
||
module.exports = { | ||
...baseConfig | ||
}; |
Oops, something went wrong.