CI: New jobs
This follows removal of jobs from project-config. [1] New jobs use newer node versions and new Zuul v3 format, reusing devstack for deployment of OpenStack for functional testing of jslib. Version tests have been adapted to follow support logic already in place instead of hardcoded supported versions. Includes workaround (fixup) of devstack's bug. [2] Move the functional test to experimental for now, because version discovery doesn't work right and Firefox is generally grumpy. We want to get the structural stuff in first. [1] https://review.opendev.org/702030 [2] https://bugs.launchpad.net/devstack/+bug/1860287 Depends-on: https://review.opendev.org/704882 Depends-on: https://review.opendev.org/726547 Co-authored-by: Monty Taylor <mordred@inaugust.com> Change-Id: I197eb2b59be7a49d168edf09d554b444bbcc29b2
This commit is contained in:
parent
a88f833861
commit
8354146c11
4
playbooks/fetch-javascript-output.yml
Normal file
4
playbooks/fetch-javascript-output.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- fetch-javascript-output
|
14
playbooks/fixup-devstack.yml
Normal file
14
playbooks/fixup-devstack.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
# NOTE(yoctozepto): devstack starts WSGI-based, API services too early
|
||||||
|
# to make post-config apply to them
|
||||||
|
# see: https://bugs.launchpad.net/devstack/+bug/1860287
|
||||||
|
- name: "Restart devstack API services"
|
||||||
|
command: "systemctl restart devstack@{{ item }}"
|
||||||
|
become: True
|
||||||
|
loop:
|
||||||
|
- keystone
|
||||||
|
- g-api
|
||||||
|
- q-svc
|
||||||
|
- n-api
|
12
playbooks/prepare-env-for-tests.yml
Normal file
12
playbooks/prepare-env-for-tests.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- ensure-javascript-build-tool
|
||||||
|
- nodejs-test-dependencies
|
||||||
|
tasks:
|
||||||
|
# NOTE(yoctozepto): nodejs-test-dependencies role installs only
|
||||||
|
# chromium-browser but we need firefox too
|
||||||
|
- name: Install firefox
|
||||||
|
apt:
|
||||||
|
name: firefox
|
||||||
|
become: true
|
5
playbooks/run-npm.yml
Normal file
5
playbooks/run-npm.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- revoke-sudo
|
||||||
|
- js-package-manager
|
@ -85,7 +85,7 @@ export default class AbstractService {
|
|||||||
*/
|
*/
|
||||||
_rawVersions() {
|
_rawVersions() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let promise = this.http
|
this.http
|
||||||
.httpGet(this._endpointUrl)
|
.httpGet(this._endpointUrl)
|
||||||
.catch((response) => {
|
.catch((response) => {
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
@ -96,13 +96,12 @@ export default class AbstractService {
|
|||||||
|
|
||||||
return this.http.httpGet(rootUrl.href);
|
return this.http.httpGet(rootUrl.href);
|
||||||
} else {
|
} else {
|
||||||
return reject(response);
|
throw response;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
promise
|
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((body) => resolve(body.versions));
|
.then((body) => resolve(body.versions))
|
||||||
|
.catch(reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,11 +48,6 @@ describe("Glance", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("version()", () => {
|
describe("version()", () => {
|
||||||
|
|
||||||
const supportedApiVersions = [
|
|
||||||
new Version('2.5')
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test acts as a canary, to inform the SDK developers that the Glance API
|
* This test acts as a canary, to inform the SDK developers that the Glance API
|
||||||
* has changed in a significant way.
|
* has changed in a significant way.
|
||||||
@ -62,14 +57,7 @@ describe("Glance", () => {
|
|||||||
.then((config) => new Glance(config))
|
.then((config) => new Glance(config))
|
||||||
.then((glance) => glance.version())
|
.then((glance) => glance.version())
|
||||||
.then((apiVersion) => {
|
.then((apiVersion) => {
|
||||||
for (let i = 0; i < supportedApiVersions.length; i++) {
|
expect(apiVersion instanceof Version).not.toBeFalsy();
|
||||||
let supportedVersion = supportedApiVersions[i];
|
|
||||||
if (apiVersion.equals(supportedVersion)) {
|
|
||||||
done();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fail(`Current devstack glance version (${apiVersion}) is not supported.`);
|
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch((error) => done.fail(error));
|
.catch((error) => done.fail(error));
|
||||||
|
@ -41,11 +41,6 @@ describe("Keystone", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("version()", () => {
|
describe("version()", () => {
|
||||||
|
|
||||||
const supportedApiVersions = [
|
|
||||||
new Version('3.8')
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test acts as a canary, to inform the SDK developers that the Keystone API
|
* This test acts as a canary, to inform the SDK developers that the Keystone API
|
||||||
* has changed in a significant way.
|
* has changed in a significant way.
|
||||||
@ -53,14 +48,7 @@ describe("Keystone", () => {
|
|||||||
it("should return a supported version.", (done) => {
|
it("should return a supported version.", (done) => {
|
||||||
keystone.version()
|
keystone.version()
|
||||||
.then((apiVersion) => {
|
.then((apiVersion) => {
|
||||||
for (let i = 0; i < supportedApiVersions.length; i++) {
|
expect(apiVersion instanceof Version).not.toBeFalsy();
|
||||||
let supportedVersion = supportedApiVersions[i];
|
|
||||||
if (apiVersion.equals(supportedVersion)) {
|
|
||||||
done();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fail(`Current devstack keystone version (${apiVersion}) is not supported.`);
|
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch((response) => response.json()
|
.catch((response) => response.json()
|
||||||
|
@ -48,11 +48,6 @@ describe("neutron", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("version()", () => {
|
describe("version()", () => {
|
||||||
|
|
||||||
const supportedApiVersions = [
|
|
||||||
new Version('2.0')
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test acts as a canary, to inform the SDK developers that the Neutron API
|
* This test acts as a canary, to inform the SDK developers that the Neutron API
|
||||||
* has changed in a significant way.
|
* has changed in a significant way.
|
||||||
@ -62,14 +57,7 @@ describe("neutron", () => {
|
|||||||
.then((config) => new Neutron(config))
|
.then((config) => new Neutron(config))
|
||||||
.then((neutron) => neutron.version())
|
.then((neutron) => neutron.version())
|
||||||
.then((apiVersion) => {
|
.then((apiVersion) => {
|
||||||
for (let i = 0; i < supportedApiVersions.length; i++) {
|
expect(apiVersion instanceof Version).not.toBeFalsy();
|
||||||
let supportedVersion = supportedApiVersions[i];
|
|
||||||
if (apiVersion.equals(supportedVersion)) {
|
|
||||||
done();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fail(`Current devstack neutron version (${apiVersion}) is not supported.`);
|
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch((error) => done.fail(error));
|
.catch((error) => done.fail(error));
|
||||||
|
@ -34,10 +34,6 @@ describe("Nova", () => {
|
|||||||
.then((entry) => entry.endpoints.find((endpoint) => endpoint.interface === 'public'));
|
.then((entry) => entry.endpoints.find((endpoint) => endpoint.interface === 'public'));
|
||||||
|
|
||||||
describe("version()", () => {
|
describe("version()", () => {
|
||||||
const supportedApiVersions = [
|
|
||||||
new Version('2.1')
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test acts as a canary, to inform the SDK developers that the Nova API
|
* This test acts as a canary, to inform the SDK developers that the Nova API
|
||||||
* has changed in a significant way.
|
* has changed in a significant way.
|
||||||
@ -47,8 +43,7 @@ describe("Nova", () => {
|
|||||||
.then((config) => new Nova(config))
|
.then((config) => new Nova(config))
|
||||||
.then((nova) => nova.version())
|
.then((nova) => nova.version())
|
||||||
.then((apiVersion) => {
|
.then((apiVersion) => {
|
||||||
let found = supportedApiVersions.find((item) => item.equals(apiVersion));
|
expect(apiVersion instanceof Version).not.toBeFalsy();
|
||||||
expect(found).not.toBeFalsy();
|
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch((error) => done.fail(error));
|
.catch((error) => done.fail(error));
|
||||||
|
65
zuul.d/jobs.yaml
Normal file
65
zuul.d/jobs.yaml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
- job:
|
||||||
|
name: js-openstack-lib-functional-tests-base
|
||||||
|
# We use tox-functional-consumer as a base job because it's
|
||||||
|
# the closest we've got. It'll cause tox to get installed, but
|
||||||
|
# we override the run so it shouldn't matter.
|
||||||
|
parent: devstack-tox-functional-consumer
|
||||||
|
pre-run:
|
||||||
|
- playbooks/prepare-env-for-tests.yml
|
||||||
|
# NOTE(yoctozepto): devstack starts WSGI-based, API services too early
|
||||||
|
# to make post-config apply to them
|
||||||
|
# see: https://bugs.launchpad.net/devstack/+bug/1860287
|
||||||
|
- playbooks/fixup-devstack.yml
|
||||||
|
run: playbooks/run-npm.yml
|
||||||
|
post-run:
|
||||||
|
- playbooks/fetch-javascript-output.yml
|
||||||
|
vars:
|
||||||
|
npm_command: functional-test
|
||||||
|
|
||||||
|
# NOTE(yoctozepto): we need relaxed CORS allowed_origin to be able to
|
||||||
|
# test browsers without hacking them to ignore CORS
|
||||||
|
devstack_local_conf:
|
||||||
|
post-config:
|
||||||
|
$KEYSTONE_CONF:
|
||||||
|
cors:
|
||||||
|
allowed_origin: '*'
|
||||||
|
$GLANCE_API_CONF:
|
||||||
|
cors:
|
||||||
|
allowed_origin: '*'
|
||||||
|
$NEUTRON_CONF:
|
||||||
|
cors:
|
||||||
|
allowed_origin: '*'
|
||||||
|
$NOVA_CONF:
|
||||||
|
cors:
|
||||||
|
allowed_origin: '*'
|
||||||
|
|
||||||
|
devstack_services:
|
||||||
|
tls-proxy: false # FIXME(yoctozepto): we can't have tls atm
|
||||||
|
|
||||||
|
# NOTE(yoctozepto): disable Swift & Cinder - not tested atm
|
||||||
|
# but enabled by parent (let's conserve resources)
|
||||||
|
|
||||||
|
# Swift services
|
||||||
|
s-account: false
|
||||||
|
s-container: false
|
||||||
|
s-object: false
|
||||||
|
s-proxy: false
|
||||||
|
|
||||||
|
# Cinder services
|
||||||
|
c-api: false
|
||||||
|
c-bak: false
|
||||||
|
c-sch: false
|
||||||
|
c-vol: false
|
||||||
|
cinder: false
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: js-openstack-lib-unit-tests-nodejs12
|
||||||
|
parent: nodejs-run-test-browser
|
||||||
|
vars:
|
||||||
|
node_version: 12
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: js-openstack-lib-functional-tests-nodejs12
|
||||||
|
parent: js-openstack-lib-functional-tests-base
|
||||||
|
vars:
|
||||||
|
node_version: 12
|
15
zuul.d/project.yaml
Normal file
15
zuul.d/project.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
- project:
|
||||||
|
templates:
|
||||||
|
- nodejs8-docs
|
||||||
|
- nodejs8-jobs
|
||||||
|
- nodejs8-publish-to-npm
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- js-openstack-lib-unit-tests-nodejs12
|
||||||
|
gate:
|
||||||
|
jobs:
|
||||||
|
- js-openstack-lib-unit-tests-nodejs12
|
||||||
|
experimental:
|
||||||
|
jobs:
|
||||||
|
- js-openstack-lib-functional-tests-nodejs12
|
Loading…
Reference in New Issue
Block a user