Merge pull request #2309 from matburt/zuul_job_configuration

Add an initial check and gate job configuration for zuul

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2018-10-08 13:09:24 +00:00 committed by GitHub
commit 1edede213e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 2621 additions and 3073 deletions

View File

@ -329,7 +329,7 @@ We like to keep our commit history clean, and will require resubmission of pull
Sometimes it might take us a while to fully review your PR. We try to keep the `devel` branch in good working order, and so we review requests carefully. Please be patient.
All submitted PRs will have the linter and unit tests run against them, and the status reported in the PR.
All submitted PRs will have the linter and unit tests run against them via Zuul, and the status reported in the PR.
## Reporting Issues

View File

@ -364,7 +364,7 @@ test:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
py.test -n auto $(TEST_DIRS)
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
test_combined: test_ansible test
@ -564,6 +564,13 @@ docker-compose-cluster: docker-auth
docker-compose-test: docker-auth
cd tools && TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /bin/bash
docker-compose-runtest:
cd tools && TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /start_tests.sh
docker-compose-clean:
cd tools && TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose run --rm -w /awx_devel --service-ports awx make clean
cd tools && TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose rm -sf
docker-compose-build: awx-devel-build
# Base development image build

5450
awx/ui/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@
"pretest": "",
"test": "karma start test/spec/karma.spec.js",
"jshint": "grunt jshint:source --no-color",
"test:ci": "npm run test -- --single-run --reporter junit,dots --browsers=PhantomJS",
"test:ci": "npm run test -- --single-run --reporter junit,dots --browsers=chromeHeadless",
"e2e": "./test/e2e/runner.js --config ./test/e2e/nightwatch.conf.js --suiteRetries=2",
"unit": "karma start test/unit/karma.unit.js",
"lint": "eslint .",
@ -74,7 +74,6 @@
"karma-html2js-preprocessor": "^1.0.0",
"karma-jasmine": "^1.1.0",
"karma-junit-reporter": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.4",
"less": "^2.7.2",
@ -86,7 +85,7 @@
"nightwatch": "^0.9.19",
"node-object-hash": "^1.3.0",
"nunjucks": "^3.1.2",
"phantomjs-prebuilt": "^2.1.12",
"puppeteer": "^1.8.0",
"time-grunt": "^1.4.0",
"uglifyjs-webpack-plugin": "^0.4.6",
"uuid": "^3.1.0",

View File

@ -1,10 +1,11 @@
const path = require('path');
const webpackConfig = require('./webpack.spec');
process.env.CHROME_BIN = require('puppeteer').executablePath();
const SRC_PATH = path.resolve(__dirname, '../../client/src');
const NODE_MODULES = path.resolve(__dirname, '../../node_modules');
const webpackConfig = require('./webpack.spec');
module.exports = config => {
config.set({
basePath: '../..',
@ -14,7 +15,6 @@ module.exports = config => {
frameworks: ['jasmine'],
reporters: ['progress', 'junit'],
files:[
'test/spec/polyfills.js',
'client/src/vendor.js',
path.join(NODE_MODULES, 'angular-mocks/angular-mocks.js'),
path.join(SRC_PATH, 'app.js'),
@ -35,6 +35,18 @@ module.exports = config => {
outputDir: 'reports',
outputFile: 'results.spec.xml',
useBrowserName: false
}
},
customLaunchers: {
chromeHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222',
],
},
},
});
};

View File

@ -1,31 +0,0 @@
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
if (typeof Object.assign != 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
value: function assign(target, varArgs) { // .length of function is 2
'use strict';
if (target == null) { // TypeError if undefined or null
throw new TypeError('Cannot convert undefined or null to object');
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource != null) { // Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true
});
}

View File

@ -1,9 +1,10 @@
const path = require('path');
const webpackConfig = require('../../build/webpack.test.js');
process.env.CHROME_BIN = require('puppeteer').executablePath();
const SRC_PATH = path.resolve(__dirname, '../../client/src');
const webpackConfig = require('./webpack.unit');
module.exports = config => {
config.set({
basePath: '',
@ -11,10 +12,9 @@ module.exports = config => {
autoWatch: false,
colors: true,
frameworks: ['jasmine'],
browsers: ['PhantomJS'],
browsers: ['chromeHeadless'],
reporters: ['progress', 'junit'],
files: [
'./polyfills.js',
path.join(SRC_PATH, 'vendor.js'),
path.join(SRC_PATH, 'app.js'),
path.join(SRC_PATH, '**/*.html'),
@ -24,7 +24,7 @@ module.exports = config => {
'karma-webpack',
'karma-jasmine',
'karma-junit-reporter',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-html2js-preprocessor'
],
preprocessors: {
@ -41,6 +41,18 @@ module.exports = config => {
outputDir: 'reports',
outputFile: 'results.unit.xml',
useBrowserName: false
}
},
customLaunchers: {
chromeHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222',
],
},
},
});
};

View File

@ -1,33 +0,0 @@
/* eslint-disable */
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
if (typeof Object.assign != 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
value: function assign(target, varArgs) { // .length of function is 2
'use strict';
if (target == null) { // TypeError if undefined or null
throw new TypeError('Cannot convert undefined or null to object');
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource != null) { // Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true
});
}

View File

@ -16,7 +16,6 @@ pytest-timeout
pytest-xdist
logutils
flower
uwsgitop
jupyter
matplotlib
backports.tempfile # support in unit tests for py32+ tempfile.TemporaryDirectory

View File

@ -1,31 +0,0 @@
runtime:
nodePool: awx
language: python
python:
- 2.7
env:
- AWX_BUILD_TARGET=test
- AWX_BUILD_TARGET=ui-test-ci
- AWX_BUILD_TARGET="flake8 jshint"
- AWX_BUILD_TARGET="swagger"
branches:
only:
- devel
- release_*
build:
pre_ci:
- docker build -t ansible/awx_devel -f tools/docker-compose/Dockerfile .
- docker tag ansible/awx_devel gcr.io/ansible-tower-engineering/awx_devel:latest
pre_ci_boot:
options: "-v /awx_devel:/awx_devel"
ci:
- cp -R . /awx_devel
- 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 run unit-tests "make ${AWX_BUILD_TARGET}"
- python tools/docker-compose/unit-tests/collect_shippable_results.py

View File

@ -25,6 +25,7 @@ ADD tools/docker-compose/awx.egg-info /tmp/awx.egg-info
RUN ln -Ffs /awx_devel/tools/docker-compose/nginx.conf /etc/nginx/nginx.conf
RUN ln -Ffs /awx_devel/tools/docker-compose/nginx.vh.default.conf /etc/nginx/conf.d/nginx.vh.default.conf
RUN ln -s /awx_devel/tools/docker-compose/start_development.sh /start_development.sh
RUN ln -s /awx_devel/tools/docker-compose/start_tests.sh /start_tests.sh
RUN ln -s /awx_devel/tools/docker-compose/bootstrap_development.sh /bootstrap_development.sh
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost"
RUN openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt

View File

@ -0,0 +1,9 @@
set +x
cd /awx_devel
make clean
cp -R /tmp/awx.egg-info /awx_devel/ || true
sed -i "s/placeholder/$(cat /awx_devel/VERSION)/" /awx_devel/awx.egg-info/PKG-INFO
cp /tmp/awx.egg-link /venv/awx/lib/python2.7/site-packages/awx.egg-link
cp awx/settings/local_settings.py.docker_compose awx/settings/local_settings.py
make test

View File

@ -2,7 +2,7 @@
# Code duplicated from start_development.sh
cp -R /tmp/awx.egg-info /awx_devel/ || true
sed -i "s/placeholder/$(git describe --long | sed 's/\./\\./g')/" /awx_devel/awx.egg-info/PKG-INFO
sed -i "s/placeholder/$(cat /awx_devel/VERSION)/" /awx_devel/awx.egg-info/PKG-INFO
cp /tmp/awx.egg-link /venv/awx/lib/python2.7/site-packages/awx.egg-link
cp -f awx/settings/local_settings.py.docker_compose awx/settings/local_settings.py

76
tox.ini
View File

@ -5,73 +5,59 @@ envlist =
ui-lint,
api,
ui,
coveralls
[testenv]
basepython = python2.7
setenv =
DJANGO_SETTINGS_MODULE = awx.settings.development_quiet
SWIG_FEATURES = -cpperraswarn -includeall -I/usr/include/openssl
HOME = {homedir}
USERPROFILE = {homedir}
ANSIBLE_VENV_PATH = {toxworkdir}
AWX_VENV_PATH = {toxworkdir}
SKIP_SLOW_TESTS = True
;basepython = python2.7
whitelist_externals = make
; setenv =
; DJANGO_SETTINGS_MODULE = awx.settings.development_quiet
; SWIG_FEATURES = -cpperraswarn -includeall -I/usr/include/openssl
; HOME = {homedir}
; USERPROFILE = {homedir}
; ANSIBLE_VENV_PATH = {toxworkdir}
; AWX_VENV_PATH = {toxworkdir}
; SKIP_SLOW_TESTS = True
[testenv:api-lint]
deps =
-r{toxinidir}/requirements/requirements.txt
-r{toxinidir}/requirements/requirements_dev.txt
coverage
coveralls
commands =
make flake8
flake8
[testenv:ui-lint]
deps =
nodeenv
commands =
make jshint
make clean-ui
make ui-devel
npm run --prefix awx/ui jshint
npm run --prefix awx/ui lint
[testenv:api]
deps =
-r{toxinidir}/requirements/requirements.txt
-r{toxinidir}/requirements/requirements_dev.txt
ansible
coverage
coveralls
#-r{toxinidir}/requirements/requirements.txt
#-r{toxinidir}/requirements/requirements_git.txt
#-r{toxinidir}/requirements/requirements_dev.txt
#ansible
#coverage
#coveralls
docker-compose
commands =
python setup.py develop
#python setup.py develop
# coverage run --help
# coverage run -p --source awx/main/tests -m pytest {posargs}
py.test awx/main/tests awx/conf/tests awx/sso/tests {posargs:-k 'not old'}
#py.test -n auto awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests
#awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
#make test
make docker-compose-build
make docker-compose-runtest
[testenv:ui]
deps =
nodeenv
commands =
make UI_TEST_MODE=CI test-ui
[testenv:ansible]
deps =
ansible
pytest
-r{toxinidir}/requirements/requirements_ansible.txt
commands =
{envdir}/bin/py.test awx/lib/tests/ -c awx/lib/tests/pytest.ini {posargs}
[testenv:coveralls]
commands=
coverage combine
coverage report -m
coveralls
[pytest]
DJANGO_SETTINGS_MODULE = awx.settings.development
python_paths = venv/tower/lib/python2.7/site-packages
site_dirs = venv/tower/lib/python2.7/site-packages
python_files = *.py
addopts = --reuse-db --nomigrations --tb=native
markers =
ac: access control test
license_feature: ensure license features are accessible or not depending on license
make clean-ui
make ui-devel
make ui-test-ci