-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(chore ci): change sourceRoot to deepen ng cli run scope, add ampe… (
#5674) * fix(chore ci): change sourceRoot to deepen ng cli run scope, add ampersands to prevent multiple scopes in script run. * fix(chore ci): split tests run in different applications, fix demo tests to prevent Errors while no tests in test-run. * fix(chore ci): fix variable usage in base config. * fix(chore ci): revert sourceRoot for demo project. Co-authored-by: Dmitriy Danilov <daniloff200@gmail.com> Co-authored-by: Irina Ershova <ershova.ira92@gmail.com>
- Loading branch information
1 parent
4ba64f0
commit 198cdf1
Showing
9 changed files
with
218 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,23 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { TestBed, async, ComponentFixture } from '@angular/core/testing'; | ||
import { AppComponent } from './app.component'; | ||
import { AppModule } from './app.module'; | ||
|
||
describe('App: Ng2Bootstrap', () => { | ||
let fixture: ComponentFixture<AppComponent>; | ||
/* tslint:disable-next-line: no-any */ | ||
let context: any; | ||
|
||
xdescribe('App: Ng2Bootstrap', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [AppComponent] | ||
imports: [AppModule] | ||
}); | ||
}); | ||
|
||
it( | ||
'should create the app', | ||
async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
let app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
}) | ||
); | ||
|
||
it( | ||
`should have as title 'app works!'`, | ||
async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
let app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('app works!'); | ||
}) | ||
); | ||
fixture = TestBed.createComponent(AppComponent); | ||
context = fixture.componentInstance; | ||
}); | ||
|
||
it( | ||
'should render title in a h1 tag', | ||
async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
let compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('app works!'); | ||
it('should create the app', (() => { | ||
expect(context).toBeTruthy(); | ||
}) | ||
); | ||
}); |
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,113 +1,11 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/0.13/config/configuration-file.html | ||
|
||
module.exports = function (config) { | ||
const configuration = { | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-firefox-launcher'), | ||
require('karma-ie-launcher'), | ||
require('karma-edge-launcher'), | ||
require('karma-safari-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage-istanbul-reporter'), | ||
require('@angular-devkit/build-angular/plugins/karma') | ||
], | ||
coverageIstanbulReporter: { | ||
dir: require('path').join(__dirname, 'coverage'), | ||
reports: ['html', 'lcovonly', 'text'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
angularCli: { | ||
environment: 'dev' | ||
}, | ||
reporters: config.angularCli && config.angularCli.codeCoverage | ||
? ['dots', 'coverage-istanbul'] | ||
: ['dots', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['ChromeHeadless'], | ||
browserNoActivityTimeout: 20000, | ||
browserDisconnectTolerance: 2, | ||
browserDisconnectTimeout: 5000, | ||
singleRun: true, | ||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'ChromeHeadless', | ||
flags: [ | ||
'--headless', | ||
'--disable-gpu', | ||
'--no-sandbox', | ||
'--remote-debugging-port=9222' | ||
] | ||
} | ||
}, | ||
mime: {'text/x-typescript': ['ts', 'tsx']}, | ||
client: {captureConsole: true, clearContext: false} | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
configuration.browsers = ['Chrome_travis_ci']; | ||
} | ||
|
||
if (process.env.SAUCE) { | ||
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) { | ||
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.'); | ||
process.exit(1); | ||
} | ||
|
||
configuration.plugins.push(require('karma-sauce-launcher')); | ||
Object.assign(configuration, { | ||
logLevel: config.LOG_INFO, | ||
reporters: ['dots', 'saucelabs'], | ||
singleRun: true, | ||
concurrency: 4, | ||
captureTimeout: 60000, | ||
sauceLabs: { | ||
testName: 'ngx-bootstrap', | ||
build: process.env.TRAVIS_JOB_NUMBER, | ||
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER, | ||
// retryLimit: 5, | ||
startConnect: false, | ||
recordVideo: false, | ||
recordScreenshots: false, | ||
options: { | ||
'command-timeout': 600, | ||
'idle-timeout': 600, | ||
'max-duration': 5400 | ||
} | ||
}, | ||
customLaunchers: { | ||
//LATEST | ||
'SL_FIREFOX': { | ||
base: 'SauceLabs', | ||
browserName: 'firefox', | ||
version: 'latest' | ||
}, | ||
'SL_IE11': { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows 8.1', | ||
version: '11.0' | ||
}, | ||
'SL_EDGE': { | ||
base: 'SauceLabs', | ||
browserName: 'MicrosoftEdge', | ||
version: 'latest' | ||
}, | ||
'SL_SAFARI': { | ||
base: 'SauceLabs', | ||
browserName: 'safari', | ||
version: '11' | ||
} | ||
} | ||
}); | ||
configuration.browsers = Object.keys(configuration.customLaunchers); | ||
} | ||
config.set(configuration); | ||
}; | ||
module.exports = require('./karma.base.conf')({ | ||
coverageIstanbulReporter: { | ||
dir: require('path').join(__dirname, 'coverage/demo'), | ||
reports: ['html', 'lcovonly', 'text'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
port: 9876, | ||
}); |
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,11 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/0.13/config/configuration-file.html | ||
|
||
module.exports = require('./karma.base.conf')({ | ||
coverageIstanbulReporter: { | ||
dir: require('path').join(__dirname, 'coverage/source'), | ||
reports: ['html', 'lcovonly', 'text'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
port: 9875, | ||
}); |
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,116 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/0.13/config/configuration-file.html | ||
|
||
module.exports = function(projectConfig) { | ||
return function (config) { | ||
const baseConfiguration = { | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-firefox-launcher'), | ||
require('karma-ie-launcher'), | ||
require('karma-edge-launcher'), | ||
require('karma-safari-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage-istanbul-reporter'), | ||
require('@angular-devkit/build-angular/plugins/karma') | ||
], | ||
coverageIstanbulReporter: { | ||
dir: require('path').join(__dirname, 'coverage'), | ||
reports: ['html', 'lcovonly', 'text'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
angularCli: { | ||
environment: 'dev' | ||
}, | ||
reporters: config.angularCli && config.angularCli.codeCoverage | ||
? ['dots', 'coverage-istanbul'] | ||
: ['dots', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['ChromeHeadless'], | ||
browserNoActivityTimeout: 20000, | ||
browserDisconnectTolerance: 2, | ||
browserDisconnectTimeout: 5000, | ||
singleRun: true, | ||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'ChromeHeadless', | ||
flags: [ | ||
'--headless', | ||
'--disable-gpu', | ||
'--no-sandbox', | ||
'--remote-debugging-port=9222' | ||
] | ||
} | ||
}, | ||
mime: {'text/x-typescript': ['ts', 'tsx']}, | ||
client: {captureConsole: true, clearContext: false} | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
baseConfiguration.browsers = ['Chrome_travis_ci']; | ||
} | ||
|
||
if (process.env.SAUCE) { | ||
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) { | ||
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.'); | ||
process.exit(1); | ||
} | ||
|
||
baseConfiguration.plugins.push(require('karma-sauce-launcher')); | ||
Object.assign(baseConfiguration, { | ||
logLevel: config.LOG_INFO, | ||
reporters: ['dots', 'saucelabs'], | ||
singleRun: true, | ||
concurrency: 4, | ||
captureTimeout: 60000, | ||
sauceLabs: { | ||
testName: 'ngx-bootstrap', | ||
build: process.env.TRAVIS_JOB_NUMBER, | ||
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER, | ||
// retryLimit: 5, | ||
startConnect: false, | ||
recordVideo: false, | ||
recordScreenshots: false, | ||
options: { | ||
'command-timeout': 600, | ||
'idle-timeout': 600, | ||
'max-duration': 5400 | ||
} | ||
}, | ||
customLaunchers: { | ||
//LATEST | ||
'SL_FIREFOX': { | ||
base: 'SauceLabs', | ||
browserName: 'firefox', | ||
version: 'latest' | ||
}, | ||
'SL_IE11': { | ||
base: 'SauceLabs', | ||
browserName: 'internet explorer', | ||
platform: 'Windows 8.1', | ||
version: '11.0' | ||
}, | ||
'SL_EDGE': { | ||
base: 'SauceLabs', | ||
browserName: 'MicrosoftEdge', | ||
version: 'latest' | ||
}, | ||
'SL_SAFARI': { | ||
base: 'SauceLabs', | ||
browserName: 'safari', | ||
version: '11' | ||
} | ||
} | ||
}); | ||
baseConfiguration.browsers = Object.keys(baseConfiguration.customLaunchers); | ||
} | ||
|
||
config.set(Object.assign({}, baseConfiguration, projectConfig)); | ||
}; | ||
}; |
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
Oops, something went wrong.