mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
collect unit test results for shippable
Signed-off-by: Jake McDermott <jmcdermott@ansible.com>
This commit is contained in:
4
Makefile
4
Makefile
@@ -83,7 +83,9 @@ I18N_FLAG_FILE = .i18n_built
|
|||||||
clean-ui:
|
clean-ui:
|
||||||
rm -rf awx/ui/static/
|
rm -rf awx/ui/static/
|
||||||
rm -rf awx/ui/node_modules/
|
rm -rf awx/ui/node_modules/
|
||||||
rm -rf awx/ui/coverage/
|
rm -rf awx/ui/test/unit/reports/
|
||||||
|
rm -rf awx/ui/test/spec/reports/
|
||||||
|
rm -rf awx/ui/test/e2e/reports/
|
||||||
rm -rf awx/ui/client/languages/
|
rm -rf awx/ui/client/languages/
|
||||||
rm -f $(UI_DEPS_FLAG_FILE)
|
rm -f $(UI_DEPS_FLAG_FILE)
|
||||||
rm -f $(UI_RELEASE_FLAG_FILE)
|
rm -f $(UI_RELEASE_FLAG_FILE)
|
||||||
|
|||||||
@@ -5,20 +5,13 @@ const NODE_MODULES = path.resolve(__dirname, '../../node_modules');
|
|||||||
|
|
||||||
const webpackConfig = require('./webpack.spec');
|
const webpackConfig = require('./webpack.spec');
|
||||||
|
|
||||||
module.exports = function(config) {
|
module.exports = config => {
|
||||||
config.set({
|
config.set({
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
browsers: ['Chrome', 'Firefox'],
|
browsers: ['Chrome', 'Firefox'],
|
||||||
coverageReporter: {
|
frameworks: ['jasmine'],
|
||||||
reporters: [
|
reporters: ['progress', 'junit'],
|
||||||
{ type: 'html', subdir: 'html' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
frameworks: [
|
|
||||||
'jasmine',
|
|
||||||
],
|
|
||||||
reporters: ['progress', 'coverage', 'junit'],
|
|
||||||
files:[
|
files:[
|
||||||
path.join(SRC_PATH, '**/*.html'),
|
path.join(SRC_PATH, '**/*.html'),
|
||||||
path.join(SRC_PATH, 'vendor.js'),
|
path.join(SRC_PATH, 'vendor.js'),
|
||||||
@@ -37,8 +30,8 @@ module.exports = function(config) {
|
|||||||
noInfo: true
|
noInfo: true
|
||||||
},
|
},
|
||||||
junitReporter: {
|
junitReporter: {
|
||||||
outputDir: 'coverage',
|
outputDir: 'reports',
|
||||||
outputFile: 'ui-unit-test-results.xml',
|
outputFile: 'results.spec.xml',
|
||||||
useBrowserName: false
|
useBrowserName: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module.exports = config => {
|
|||||||
colors: true,
|
colors: true,
|
||||||
frameworks: ['jasmine'],
|
frameworks: ['jasmine'],
|
||||||
browsers: ['PhantomJS'],
|
browsers: ['PhantomJS'],
|
||||||
reporters: ['progress'],
|
reporters: ['progress', 'junit'],
|
||||||
files: [
|
files: [
|
||||||
path.join(SRC_PATH, 'vendor.js'),
|
path.join(SRC_PATH, 'vendor.js'),
|
||||||
path.join(SRC_PATH, 'app.js'),
|
path.join(SRC_PATH, 'app.js'),
|
||||||
@@ -22,6 +22,7 @@ module.exports = config => {
|
|||||||
plugins: [
|
plugins: [
|
||||||
'karma-webpack',
|
'karma-webpack',
|
||||||
'karma-jasmine',
|
'karma-jasmine',
|
||||||
|
'karma-junit-reporter',
|
||||||
'karma-phantomjs-launcher',
|
'karma-phantomjs-launcher',
|
||||||
'karma-html2js-preprocessor'
|
'karma-html2js-preprocessor'
|
||||||
],
|
],
|
||||||
@@ -34,6 +35,11 @@ module.exports = config => {
|
|||||||
webpack: webpackConfig,
|
webpack: webpackConfig,
|
||||||
webpackMiddleware: {
|
webpackMiddleware: {
|
||||||
noInfo: 'errors-only'
|
noInfo: 'errors-only'
|
||||||
|
},
|
||||||
|
junitReporter: {
|
||||||
|
outputDir: 'reports',
|
||||||
|
outputFile: 'results.unit.xml',
|
||||||
|
useBrowserName: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,3 +24,4 @@ build:
|
|||||||
- pip install -U docker-compose
|
- pip install -U docker-compose
|
||||||
- docker-compose -f tools/docker-compose/unit-tests/docker-compose-shippable.yml build --build-arg TAG=latest unit-tests
|
- docker-compose -f tools/docker-compose/unit-tests/docker-compose-shippable.yml build --build-arg TAG=latest unit-tests
|
||||||
- docker-compose -f tools/docker-compose/unit-tests/docker-compose-shippable.yml run unit-tests "make ${AWX_BUILD_TARGET}"
|
- docker-compose -f tools/docker-compose/unit-tests/docker-compose-shippable.yml run unit-tests "make ${AWX_BUILD_TARGET}"
|
||||||
|
- python tools/docker-compose/unit-tests/collect_shippable_results.py
|
||||||
|
|||||||
32
tools/docker-compose/unit-tests/collect_shippable_results.py
Normal file
32
tools/docker-compose/unit-tests/collect_shippable_results.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
import errno
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
|
def copy_if_exists(src, dst):
|
||||||
|
if os.path.isfile(src):
|
||||||
|
shutil.copy2(src, dst)
|
||||||
|
|
||||||
|
|
||||||
|
def ensure_directory_exists(path):
|
||||||
|
try:
|
||||||
|
os.makedirs(path)
|
||||||
|
except OSError as exc:
|
||||||
|
if exc.errno == errno.EEXIST and os.path.isdir(path):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
collection_path = 'shippable/testresults'
|
||||||
|
|
||||||
|
ensure_directory_exists(collection_path)
|
||||||
|
|
||||||
|
copy_if_exists('/awx_devel/awx/ui/test/spec/reports/results.spec.xml', collection_path)
|
||||||
|
copy_if_exists('/awx_devel/awx/ui/test/unit/reports/results.unit.xml', collection_path)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
run()
|
||||||
Reference in New Issue
Block a user