mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-4625] Add ADF linking to unit tests and e2es (#2853)
This commit is contained in:
parent
bd77253200
commit
cb84a06e25
10
.travis.yml
10
.travis.yml
@ -71,29 +71,29 @@ jobs:
|
|||||||
|
|
||||||
- stage: Quality and Unit tests
|
- stage: Quality and Unit tests
|
||||||
name: 'Unit tests: aos'
|
name: 'Unit tests: aos'
|
||||||
script: npm ci && ng test adf-office-services-ext
|
script: npm ci && ng test adf-office-services-ext $TEST_OPTS
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- stage: Quality and Unit tests
|
- stage: Quality and Unit tests
|
||||||
name: 'Unit tests: aca-shared'
|
name: 'Unit tests: aca-shared'
|
||||||
script: npm ci && ng test aca-shared
|
script: npm ci && ng test aca-shared $TEST_OPTS
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- stage: Quality and Unit tests
|
- stage: Quality and Unit tests
|
||||||
name: 'Unit tests: aca-settings'
|
name: 'Unit tests: aca-settings'
|
||||||
script: npm ci && ng test aca-settings
|
script: npm ci && ng test aca-settings $TEST_OPTS
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- stage: Quality and Unit tests
|
- stage: Quality and Unit tests
|
||||||
name: 'Unit tests: aca-folder-rules'
|
name: 'Unit tests: aca-folder-rules'
|
||||||
script: npm ci && ng test aca-folder-rules
|
script: npm ci && ng test aca-folder-rules $TEST_OPTS
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- stage: Quality and Unit tests
|
- stage: Quality and Unit tests
|
||||||
name: 'Unit tests: ACA'
|
name: 'Unit tests: ACA'
|
||||||
script:
|
script:
|
||||||
- npm ci
|
- npm ci
|
||||||
- ng test content-ce
|
- ng test content-ce $TEST_OPTS
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- stage: e2e
|
- stage: e2e
|
||||||
|
25
angular.json
25
angular.json
@ -307,6 +307,11 @@
|
|||||||
"output": "/"
|
"output": "/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"adfprod": {
|
||||||
|
"tsConfig": "app/tsconfig.spec.adf.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
@ -387,6 +392,11 @@
|
|||||||
"main": "projects/adf-office-services-ext/src/test.ts",
|
"main": "projects/adf-office-services-ext/src/test.ts",
|
||||||
"tsConfig": "projects/adf-office-services-ext/tsconfig.spec.json",
|
"tsConfig": "projects/adf-office-services-ext/tsconfig.spec.json",
|
||||||
"karmaConfig": "projects/adf-office-services-ext/karma.conf.js"
|
"karmaConfig": "projects/adf-office-services-ext/karma.conf.js"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"adfprod": {
|
||||||
|
"tsConfig": "projects/adf-office-services-ext/tsconfig.spec.adf.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
@ -427,6 +437,11 @@
|
|||||||
"main": "projects/aca-shared/test.ts",
|
"main": "projects/aca-shared/test.ts",
|
||||||
"tsConfig": "projects/aca-shared/tsconfig.spec.json",
|
"tsConfig": "projects/aca-shared/tsconfig.spec.json",
|
||||||
"karmaConfig": "projects/aca-shared/karma.conf.js"
|
"karmaConfig": "projects/aca-shared/karma.conf.js"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"adfprod": {
|
||||||
|
"tsConfig": "projects/aca-shared/tsconfig.spec.adf.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
@ -513,6 +528,11 @@
|
|||||||
"main": "projects/aca-settings/src/test.ts",
|
"main": "projects/aca-settings/src/test.ts",
|
||||||
"tsConfig": "projects/aca-settings/tsconfig.spec.json",
|
"tsConfig": "projects/aca-settings/tsconfig.spec.json",
|
||||||
"karmaConfig": "projects/aca-settings/karma.conf.js"
|
"karmaConfig": "projects/aca-settings/karma.conf.js"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"adfprod": {
|
||||||
|
"tsConfig": "projects/aca-settings/tsconfig.spec.adf.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
@ -553,6 +573,11 @@
|
|||||||
"main": "projects/aca-folder-rules/src/test.ts",
|
"main": "projects/aca-folder-rules/src/test.ts",
|
||||||
"tsConfig": "projects/aca-folder-rules/tsconfig.spec.json",
|
"tsConfig": "projects/aca-folder-rules/tsconfig.spec.json",
|
||||||
"karmaConfig": "projects/aca-folder-rules/karma.conf.js"
|
"karmaConfig": "projects/aca-folder-rules/karma.conf.js"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"adfprod": {
|
||||||
|
"tsConfig": "projects/aca-folder-rules/tsconfig.spec.adf.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../../tsconfig.adf.json",
|
"extends": "../tsconfig.adf.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../out-tsc/spec",
|
"outDir": "../out-tsc/spec",
|
||||||
"module": "commonjs"
|
"module": "commonjs"
|
||||||
@ -15,4 +15,4 @@
|
|||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"skipTemplateCodegen": false
|
"skipTemplateCodegen": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
e2e/tsconfig.e2e.adf.json
Normal file
15
e2e/tsconfig.e2e.adf.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.adf.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../out-tsc/e2e",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es2017",
|
||||||
|
"types": ["jasmine", "jasminewd2", "node"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"paths": {
|
||||||
|
"@alfresco/aca-testing-shared": ["../projects/aca-testing-shared"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
16
projects/aca-folder-rules/tsconfig.spec.adf.json
Normal file
16
projects/aca-folder-rules/tsconfig.spec.adf.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.adf.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/test.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
16
projects/aca-settings/tsconfig.spec.adf.json
Normal file
16
projects/aca-settings/tsconfig.spec.adf.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.adf.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/test.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
9
projects/aca-shared/tsconfig.spec.adf.json
Normal file
9
projects/aca-shared/tsconfig.spec.adf.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.adf.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../out-tsc/spec",
|
||||||
|
"types": ["jasmine", "node"]
|
||||||
|
},
|
||||||
|
"files": ["test.ts"],
|
||||||
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||||
|
}
|
9
projects/adf-office-services-ext/tsconfig.spec.adf.json
Normal file
9
projects/adf-office-services-ext/tsconfig.spec.adf.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.adf.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../out-tsc/spec",
|
||||||
|
"types": ["jasmine", "node"]
|
||||||
|
},
|
||||||
|
"files": ["src/test.ts"],
|
||||||
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||||
|
}
|
@ -22,6 +22,8 @@ const SAVE_SCREENSHOT = process.env.SAVE_SCREENSHOT === 'true';
|
|||||||
const APP_CONFIG_ECM_HOST = process.env.APP_CONFIG_ECM_HOST || 'http://localhost:8080';
|
const APP_CONFIG_ECM_HOST = process.env.APP_CONFIG_ECM_HOST || 'http://localhost:8080';
|
||||||
const MAXINSTANCES = process.env.MAXINSTANCES || 1;
|
const MAXINSTANCES = process.env.MAXINSTANCES || 1;
|
||||||
const E2E_LOG_LEVEL = process.env.E2E_LOG_LEVEL || 'ERROR';
|
const E2E_LOG_LEVEL = process.env.E2E_LOG_LEVEL || 'ERROR';
|
||||||
|
const E2E_TS_CONFIG_FOR_ADF = 'tsconfig.e2e.adf.json';
|
||||||
|
const LOCAL_ADF_OPTION = '--with-local-adf';
|
||||||
|
|
||||||
|
|
||||||
const appConfig = {
|
const appConfig = {
|
||||||
@ -170,7 +172,8 @@ exports.config = {
|
|||||||
smartRunnerFactory.getInstance().onPrepare();
|
smartRunnerFactory.getInstance().onPrepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
const tsConfigPath = path.resolve(e2eFolder, 'tsconfig.e2e.json');
|
const withLocalAdf = process.argv.indexOf(LOCAL_ADF_OPTION) !== -1;
|
||||||
|
const tsConfigPath = path.resolve(e2eFolder, withLocalAdf ? E2E_TS_CONFIG_FOR_ADF : 'tsconfig.e2e.json');
|
||||||
const tsConfig = require(tsConfigPath);
|
const tsConfig = require(tsConfigPath);
|
||||||
|
|
||||||
require('ts-node').register({
|
require('ts-node').register({
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
# Build options -----------------------------------------------------------------------
|
# Build and test options -----------------------------------------------------------------------
|
||||||
export BUILD_OPTS="--configuration=production,e2e"
|
export BUILD_OPTS="--configuration=production,e2e"
|
||||||
|
export TEST_OPTS=""
|
||||||
|
export E2E_PROTRACTOR_OPTS=""
|
||||||
|
export E2E_TSCONFIG="tsconfig.e2e.json"
|
||||||
|
|
||||||
# Commit settings for ADF linking -----------------------------------------------------
|
# Commit settings for ADF linking -----------------------------------------------------
|
||||||
export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}}
|
export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}}
|
||||||
|
@ -29,6 +29,6 @@ done
|
|||||||
echo "Run alfresco-content-e2e protractor with options $OPTIONS"
|
echo "Run alfresco-content-e2e protractor with options $OPTIONS"
|
||||||
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" $OPTIONS || exit 1"
|
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" $OPTIONS || exit 1"
|
||||||
|
|
||||||
./node_modules/.bin/tsc -p "./e2e/tsconfig.e2e.json" || exit 1;
|
./node_modules/.bin/tsc -p "./e2e/$E2E_TSCONFIG" || exit 1;
|
||||||
./node_modules/.bin/http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
|
./node_modules/.bin/http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
|
||||||
./node_modules/.bin/protractor "./protractor.conf.js" $OPTIONS || exit 1
|
./node_modules/.bin/protractor "./protractor.conf.js" $OPTIONS $E2E_PROTRACTOR_OPTS || exit 1
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then
|
if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then
|
||||||
export BUILD_OPTS="--configuration=adfprod,e2e"
|
export BUILD_OPTS="--configuration=adfprod,e2e"
|
||||||
|
export TEST_OPTS="--configuration=adfprod"
|
||||||
|
export E2E_PROTRACTOR_OPTS="--with-local-adf"
|
||||||
|
export E2E_TSCONFIG="tsconfig.e2e.adf.json"
|
||||||
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
|
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
|
||||||
echo "Checking out ADF's branch: ${BRANCH}" && \
|
echo "Checking out ADF's branch: ${BRANCH}" && \
|
||||||
git clone https://github.com/Alfresco/alfresco-ng2-components.git --depth=1 --branch ${BRANCH} ../alfresco-ng2-components
|
git clone https://github.com/Alfresco/alfresco-ng2-components.git --depth=1 --branch ${BRANCH} ../alfresco-ng2-components
|
||||||
|
Loading…
x
Reference in New Issue
Block a user