Separate lint job from the test

* Split lint and test jobs
* Add lint job to be run against all files

Change-Id: I74da7999324283984d61f38ae9fb394ee5b37ce6
Closes: #386
This commit is contained in:
Sirajudeen 2020-11-04 16:14:51 +00:00
parent c86bbeaed9
commit c0f116a68c
5 changed files with 39 additions and 9 deletions

View File

@ -160,7 +160,7 @@ print-docker-image-tag:
@echo "$(DOCKER_IMAGE)" @echo "$(DOCKER_IMAGE)"
.PHONY: docker-image-test-suite .PHONY: docker-image-test-suite
docker-image-test-suite: DOCKER_MAKE_TARGET = "lint cover update-golden check-git-diff check-copyright" docker-image-test-suite: DOCKER_MAKE_TARGET = "cover update-golden check-git-diff"
docker-image-test-suite: DOCKER_TARGET_STAGE = builder docker-image-test-suite: DOCKER_TARGET_STAGE = builder
docker-image-test-suite: docker-image docker-image-test-suite: docker-image
@ -170,7 +170,7 @@ docker-image-unit-tests: DOCKER_TARGET_STAGE = builder
docker-image-unit-tests: docker-image docker-image-unit-tests: docker-image
.PHONY: docker-image-lint .PHONY: docker-image-lint
docker-image-lint: DOCKER_MAKE_TARGET = lint docker-image-lint: DOCKER_MAKE_TARGET = "lint check-copyright"
docker-image-lint: DOCKER_TARGET_STAGE = builder docker-image-lint: DOCKER_TARGET_STAGE = builder
docker-image-lint: docker-image docker-image-lint: docker-image

View File

@ -0,0 +1,20 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- hosts: primary
tasks:
- name: Run Auxiliary Linter and Check copyright header
block:
- name: "make docker-image-lint"
make:
chdir: "{{ zuul.project.src_dir }}"
target: docker-image-lint

View File

@ -12,7 +12,7 @@
- hosts: primary - hosts: primary
tasks: tasks:
- name: Run Linter, Unit Tests, Verify Golden Testdata - name: Run Unit Tests, Verify Golden Testdata
block: block:
- name: "make docker-image-test-suite" - name: "make docker-image-test-suite"
make: make:

View File

@ -27,13 +27,19 @@
- ^Makefile$ - ^Makefile$
- ^\.golangci\.yaml$ - ^\.golangci\.yaml$
- ^(go\.(mod|sum)|.*\.go)$ - ^(go\.(mod|sum)|.*\.go)$
- ^playbooks/airship-airshipctl-(golint|lint-unit)\.yaml$ - ^playbooks/airship-airshipctl-(golint|lint|unit)\.yaml$
- ^tools/(coverage_check|golint|gomod_check|install_linter)$ - ^tools/(coverage_check|golint|gomod_check|install_linter)$
- job: - job:
name: airship-airshipctl-lint-unit name: airship-airshipctl-lint
pre-run: playbooks/airship-airshipctl-deploy-docker.yaml pre-run: playbooks/airship-airshipctl-deploy-docker.yaml
run: playbooks/airship-airshipctl-lint-unit.yaml run: playbooks/airship-airshipctl-lint.yaml
nodeset: airship-airshipctl-single-node
- job:
name: airship-airshipctl-unit
pre-run: playbooks/airship-airshipctl-deploy-docker.yaml
run: playbooks/airship-airshipctl-unit.yaml
nodeset: airship-airshipctl-single-node nodeset: airship-airshipctl-single-node
files: *gofiles files: *gofiles
@ -102,10 +108,12 @@
dependencies: dependencies:
- name: openstack-tox-docs - name: openstack-tox-docs
soft: true soft: true
- name: airship-airshipctl-lint-unit - name: airship-airshipctl-lint
soft: true soft: true
- name: airship-airshipctl-golint - name: airship-airshipctl-golint
soft: true soft: true
- name: airship-airshipctl-unit
soft: true
- name: airship-airshipctl-build-image - name: airship-airshipctl-build-image
soft: true soft: true
- name: airship-airshipctl-validate-site-docs - name: airship-airshipctl-validate-site-docs

View File

@ -19,7 +19,8 @@
files: files:
- ^docs/.*$ - ^docs/.*$
- airship-airshipctl-golint - airship-airshipctl-golint
- airship-airshipctl-lint-unit - airship-airshipctl-lint
- airship-airshipctl-unit
- airship-airshipctl-roles-test - airship-airshipctl-roles-test
- airship-airshipctl-build-image - airship-airshipctl-build-image
- airship-airshipctl-validate-site-docs - airship-airshipctl-validate-site-docs
@ -29,7 +30,8 @@
gate: gate:
jobs: jobs:
- openstack-tox-docs: *docs - openstack-tox-docs: *docs
- airship-airshipctl-lint-unit - airship-airshipctl-lint
- airship-airshipctl-unit
- airship-airshipctl-build-image - airship-airshipctl-build-image
- airship-airshipctl-validate-site-docs - airship-airshipctl-validate-site-docs
- airship-airshipctl-gate-script-runner - airship-airshipctl-gate-script-runner