Publish Functest daily and gate jobs 95/61095/3
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 19 Aug 2018 11:37:31 +0000 (13:37 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 20 Aug 2018 05:03:17 +0000 (07:03 +0200)
As opposed to the Releng ones, they are designed to be easily
executed by endusers as well. They can be considered as a first step
towards a full Functest CI/CD toolchain deployed via docker-compose.

All components testcases are enabled here.

They hugely leverage on templates to load the right yamls per branch
and multijobs to run testcases in parallel. Many steps are proposed
allowing running part of the chain.

Executors have to be increased to allow running them (it was tested
vs 10 and more).

At first, all docker images are downloaded to avoid different
versions between testcases.

They will be improved in a second change to ensure that only one node
is selected and to take all Functest env vars into account.

Change-Id: I99c7b8ee5d0ddbb00102b3147739b5e8b5c65c23
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
ci/daily.yaml [new file with mode: 0644]
ci/gate.yaml [new file with mode: 0644]
ci/globals.yaml [new file with mode: 0644]
ci/run.yaml [new file with mode: 0644]
tox.ini

diff --git a/ci/daily.yaml b/ci/daily.yaml
new file mode 100644 (file)
index 0000000..8c1dd68
--- /dev/null
@@ -0,0 +1,59 @@
+---
+- job-template:
+    name: '{repo}-{container}-{tag}-pull'
+    builders:
+      - shell: docker pull {repo}/{container}:{tag}
+
+- project:
+    name: '{repo}-{container}-{tag}-pull'
+    container:
+      - functest-healthcheck
+      - functest-smoke
+      - functest-components
+      - functest-vnf
+      - functest-features
+    jobs:
+      - '{repo}-{container}-{tag}-pull'
+
+- job-template:
+    name: '{repo}-functest-{tag}-pull'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: pull all containers
+          projects:
+            - name: '{repo}-functest-healthcheck-{tag}-pull'
+            - name: '{repo}-functest-smoke-{tag}-pull'
+            - name: '{repo}-functest-components-{tag}-pull'
+            - name: '{repo}-functest-vnf-{tag}-pull'
+            - name: '{repo}-functest-features-{tag}-pull'
+
+- project:
+    name: '{repo}-functest-{tag}-pull'
+    jobs:
+      - '{repo}-functest-{tag}-pull'
+
+- job-template:
+    name: '{repo}-functest-{tag}-daily'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: pull containers
+          projects:
+            - name: '{repo}-functest-{tag}-pull'
+      - multijob:
+          name: basics tests
+          projects:
+            - name: '{repo}-functest-healthcheck-{tag}-run'
+      - multijob:
+          name: advanced tests
+          projects:
+            - name: '{repo}-functest-smoke-{tag}-run'
+            - name: '{repo}-functest-components-{tag}-run'
+            - name: '{repo}-functest-vnf-{tag}-run'
+            - name: '{repo}-functest-features-{tag}-run'
+
+- project:
+    name: '{repo}-functest-{tag}-daily'
+    jobs:
+      - '{repo}-functest-{tag}-daily'
diff --git a/ci/gate.yaml b/ci/gate.yaml
new file mode 100644 (file)
index 0000000..278ecb7
--- /dev/null
@@ -0,0 +1,107 @@
+---
+- buildparameters: &buildparameters
+    name: 'buildparameters'
+    parameters:
+      - string:
+          name: branch
+          default: '{branch}'
+
+- projectparameters: &projectparameters
+    name: 'projectparameters'
+    current-parameters: true
+
+- scm:
+    name: gerrit
+    scm:
+      - git:
+          url: https://gerrit.opnfv.org/gerrit/functest
+          refspec: '+refs/changes/*:refs/changes/*'
+          branches:
+            - ${branch}
+
+- job-template:
+    name: '{repo}-{container}-{tag}-build'
+    <<: *buildparameters
+    scm:
+      - gerrit
+    builders:
+      - shell: |
+          cd docker/$(echo {container} |cut -d\- -f 2)
+          docker build \
+            --pull=false --no-cache --force-rm=true \
+            --build-arg BRANCH=${{branch}} \
+            -t {repo}/{container}:{tag} .
+
+- project:
+    name: '{repo}-{container}-{tag}-build'
+    container:
+      - functest-core
+      - functest-tempest
+      - functest-healthcheck
+      - functest-smoke
+      - functest-components
+      - functest-vnf
+      - functest-features
+    jobs:
+      - '{repo}-{container}-{tag}-build'
+
+- job-template:
+    name: '{repo}-functest-{tag}-build'
+    project-type: multijob
+    <<: *buildparameters
+    builders:
+      - multijob:
+          name: build functest-core
+          projects:
+            - name: '{repo}-functest-core-{tag}-build'
+              <<: *projectparameters
+      - multijob:
+          name: build functest-tempest
+          projects:
+            - name: '{repo}-functest-tempest-{tag}-build'
+              <<: *projectparameters
+      - multijob:
+          name: build all remaining contrainers
+          projects:
+            - name: '{repo}-functest-healthcheck-{tag}-build'
+              <<: *projectparameters
+            - name: '{repo}-functest-smoke-{tag}-build'
+              <<: *projectparameters
+            - name: '{repo}-functest-components-{tag}-build'
+              <<: *projectparameters
+            - name: '{repo}-functest-vnf-{tag}-build'
+              <<: *projectparameters
+            - name: '{repo}-functest-features-{tag}-build'
+              <<: *projectparameters
+
+- project:
+    name: '{repo}-functest-{tag}-build'
+    jobs:
+      - '{repo}-functest-{tag}-build'
+
+- job-template:
+    name: '{repo}-functest-{tag}-gate'
+    project-type: multijob
+    <<: *buildparameters
+    builders:
+      - multijob:
+          name: build containers
+          projects:
+            - name: '{repo}-functest-{tag}-build'
+              <<: *projectparameters
+      - multijob:
+          name: basics tests
+          projects:
+            - name: '{repo}-functest-healthcheck-{tag}-run'
+      - multijob:
+          name: advanced tests
+          projects:
+            - name: '{repo}-functest-smoke-{tag}-run'
+            - name: '{repo}-functest-components-{tag}-run'
+            - name: '{repo}-functest-vnf-{tag}-run'
+            - name: '{repo}-functest-features-{tag}-run'
+
+- project:
+    name: '{repo}-functest-{tag}-gate'
+    jobs:
+      - '{repo}-functest-{tag}-gate'
diff --git a/ci/globals.yaml b/ci/globals.yaml
new file mode 100644 (file)
index 0000000..15a1d89
--- /dev/null
@@ -0,0 +1,9 @@
+---
+- defaults:
+    name: global
+    repo: 'opnfv'
+    branch: 'master'
+    tag: 'latest'
+    prefix: '/home/opnfv/functest'
+    nameserver: '8.8.8.8'
+    external_network: 'ext-net'
diff --git a/ci/run.yaml b/ci/run.yaml
new file mode 100644 (file)
index 0000000..ad2a225
--- /dev/null
@@ -0,0 +1,190 @@
+---
+- job-template:
+    name: '{repo}-{container}-{test}-{tag}-run'
+    builders:
+      - shell: |
+          docker run \
+            -e NAMESERVER={nameserver} \
+            -e EXTERNAL_NETWORK={external_network} \
+            -v \
+            {prefix}/results/$JOB_NAME-$BUILD_ID:/home/opnfv/functest/results \
+            -v {prefix}/openstack.creds:/home/opnfv/functest/conf/env_file \
+            -v {prefix}/images:/home/opnfv/functest/images \
+            {repo}/{container}:{tag} run_tests -t {test}
+
+- project:
+    name: '{repo}-healthcheck-{test}-{tag}-run'
+    container: functest-healthcheck
+    test:
+      - connection_check
+      - tenantnetwork1
+      - tenantnetwork2
+      - vmready1
+      - vmready2
+      - singlevm1
+      - singlevm2
+      - vping_ssh
+      - vping_userdata
+      - cinder_test
+      - odl
+      - api_check
+      - snaps_health_check
+    jobs:
+      - '{repo}-{container}-{test}-{tag}-run'
+
+- job-template:
+    name: '{repo}-functest-healthcheck-{tag}-run'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: healthcheck
+          projects:
+            - name: '{repo}-functest-healthcheck-connection_check-{tag}-run'
+            - name: '{repo}-functest-healthcheck-tenantnetwork1-{tag}-run'
+            - name: '{repo}-functest-healthcheck-tenantnetwork2-{tag}-run'
+            - name: '{repo}-functest-healthcheck-vmready1-{tag}-run'
+            - name: '{repo}-functest-healthcheck-vmready2-{tag}-run'
+            - name: '{repo}-functest-healthcheck-singlevm1-{tag}-run'
+            - name: '{repo}-functest-healthcheck-singlevm2-{tag}-run'
+            - name: '{repo}-functest-healthcheck-vping_ssh-{tag}-run'
+            - name: '{repo}-functest-healthcheck-vping_userdata-{tag}-run'
+            - name: '{repo}-functest-healthcheck-cinder_test-{tag}-run'
+            - name: '{repo}-functest-healthcheck-odl-{tag}-run'
+            - name: '{repo}-functest-healthcheck-api_check-{tag}-run'
+            - name: '{repo}-functest-healthcheck-snaps_health_check-{tag}-run'
+
+- project:
+    name: '{repo}-functest-healthcheck-{tag}-run'
+    jobs:
+      - '{repo}-functest-healthcheck-{tag}-run'
+
+- project:
+    name: '{repo}-smoke-{test}-{tag}-run'
+    container: functest-smoke
+    test:
+      - tempest_smoke
+      - neutron-tempest-plugin-api
+      - rally_sanity
+      - refstack_defcore
+      - patrole
+      - vmtp
+      - shaker
+      - snaps_smoke
+      - neutron_trunk
+      - networking-bgpvpn
+      - networking-sfc
+      - barbican
+    jobs:
+      - '{repo}-{container}-{test}-{tag}-run'
+
+- job-template:
+    name: '{repo}-functest-smoke-{tag}-run'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: smoke
+          projects:
+            - name: '{repo}-functest-smoke-tempest_smoke-{tag}-run'
+            - name: '{repo}-functest-smoke-neutron-tempest-plugin-api-{tag}-run'
+            - name: '{repo}-functest-smoke-rally_sanity-{tag}-run'
+            - name: '{repo}-functest-smoke-patrole-{tag}-run'
+            - name: '{repo}-functest-smoke-vmtp-{tag}-run'
+            - name: '{repo}-functest-smoke-shaker-{tag}-run'
+            - name: '{repo}-functest-smoke-snaps_smoke-{tag}-run'
+            - name: '{repo}-functest-smoke-neutron_trunk-{tag}-run'
+            - name: '{repo}-functest-smoke-networking-bgpvpn-{tag}-run'
+            - name: '{repo}-functest-smoke-networking-sfc-{tag}-run'
+            - name: '{repo}-functest-smoke-barbican-{tag}-run'
+
+- project:
+    name: '{repo}-functest-smoke-{tag}-run'
+    jobs:
+      - '{repo}-functest-smoke-{tag}-run'
+
+- project:
+    name: '{repo}-components-{test}-{tag}-run'
+    container: functest-components
+    test:
+      - tempest_full
+      - tempest_scenario
+      - rally_full
+    jobs:
+      - '{repo}-{container}-{test}-{tag}-run'
+
+- job-template:
+    name: '{repo}-functest-components-{tag}-run'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: components
+          projects:
+            - name: '{repo}-functest-components-tempest_full-{tag}-run'
+            - name: '{repo}-functest-components-tempest_scenario-{tag}-run'
+            - name: '{repo}-functest-components-rally_full-{tag}-run'
+
+- project:
+    name: '{repo}-functest-components-{tag}-run'
+    jobs:
+      - '{repo}-functest-components-{tag}-run'
+
+- project:
+    name: '{repo}-vnf-{test}-{tag}-run'
+    container: functest-vnf
+    test:
+      - cloudify
+      - cloudify_ims
+      - heat_ims
+      - vyos_vrouter
+      - juju_epc
+    jobs:
+      - '{repo}-{container}-{test}-{tag}-run'
+
+- job-template:
+    name: '{repo}-functest-vnf-{tag}-run'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: vnf
+          projects:
+            - name: '{repo}-functest-vnf-cloudify-{tag}-run'
+            - name: '{repo}-functest-vnf-cloudify_ims-{tag}-run'
+            - name: '{repo}-functest-vnf-heat_ims-{tag}-run'
+            - name: '{repo}-functest-vnf-vyos_vrouter-{tag}-run'
+            - name: '{repo}-functest-vnf-juju_epc-{tag}-run'
+
+- project:
+    name: '{repo}-functest-vnf-{tag}-run'
+    jobs:
+      - '{repo}-functest-vnf-{tag}-run'
+
+- project:
+    name: '{repo}-features-{test}-{tag}-run'
+    container: functest-features
+    test:
+      - doctor-notification
+      - bgpvpn
+      - functest-odl-sfc
+      - barometercollectd
+      - fds
+      - vgpu
+    jobs:
+      - '{repo}-{container}-{test}-{tag}-run'
+
+- job-template:
+    name: '{repo}-functest-features-{tag}-run'
+    project-type: multijob
+    builders:
+      - multijob:
+          name: features
+          projects:
+            - name: '{repo}-functest-features-doctor-notification-{tag}-run'
+            - name: '{repo}-functest-features-bgpvpn-{tag}-run'
+            - name: '{repo}-functest-features-functest-odl-sfc-{tag}-run'
+            - name: '{repo}-functest-features-barometercollectd-{tag}-run'
+            - name: '{repo}-functest-features-fds-{tag}-run'
+            - name: '{repo}-functest-features-vgpu-{tag}-run'
+
+- project:
+    name: '{repo}-functest-features-{tag}-run'
+    jobs:
+      - '{repo}-functest-features-{tag}-run'
diff --git a/tox.ini b/tox.ini
index e2afa23..12fae7c 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -89,6 +89,7 @@ commands =
 basepython = python2.7
 files =
   .travis.yml
+  ci
   docker
   functest/ci
   functest/opnfv_tests/vnf