Skip to content

Commit

Permalink
feat(build): add nebular smoke test travis step
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibing committed Sep 28, 2018
1 parent 9ae0c62 commit 4e97356
Show file tree
Hide file tree
Showing 30 changed files with 11,163 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -25,6 +25,7 @@ env:
- MODE=lint
- MODE=deploy_dev
- MODE=publish_dev
- MODE=packages_smoke
branches:
only:
- master
Expand Down
1 change: 1 addition & 0 deletions DEV_DOCS.md
Expand Up @@ -27,6 +27,7 @@
- add the package into bump-version.ts which bumps package version and its dependencies
- add the package external dependencies into rollup-config.ts which gives rollup capability build package correctly
- add the package into bundle.ts which build umd modules for our packages
- add the package into packages-smoke application dependencies to verify it works properly in isolation.

# Objectives
The aim of the project is to create a set of useful Angular modules which help to bootstrap the development.
Expand Down
4 changes: 4 additions & 0 deletions packages-smoke/README.md
@@ -0,0 +1,4 @@
# BuildSmoke

This project is used to verify all nebular packages were built properly.
We just install newly build packages in this app and build it in production mode.
151 changes: 151 additions & 0 deletions packages-smoke/angular.json
@@ -0,0 +1,151 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"packages-smoke": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "bs",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"spec": false
},
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:directive": {
"spec": false
},
"@schematics/angular:guard": {
"spec": false
},
"@schematics/angular:module": {
"spec": false
},
"@schematics/angular:pipe": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/packages-smoke",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "packages-smoke:build"
},
"configurations": {
"production": {
"browserTarget": "packages-smoke:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "packages-smoke:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"packages-smoke-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "packages-smoke:serve"
},
"configurations": {
"production": {
"devServerTarget": "packages-smoke:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "packages-smoke"
}
25 changes: 25 additions & 0 deletions packages-smoke/e2e/protractor.conf.js
@@ -0,0 +1,25 @@
const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
11 changes: 11 additions & 0 deletions packages-smoke/e2e/src/app.e2e-spec.ts
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

describe('workspace-project App', () => {
it('should render', done => {
browser.get('/')
.then(() => {
expect(element(by.css('bs-root')).getText()).toContain('Nebular Works!!!');
done();
});
});
});
13 changes: 13 additions & 0 deletions packages-smoke/e2e/tsconfig.e2e.json
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}

0 comments on commit 4e97356

Please sign in to comment.