Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
Zuul v3 job
Browse files Browse the repository at this point in the history
TG-698

Change-Id: I4c12b4bffc7b680e95a0b40e724fa93bdcfef07e
  • Loading branch information
morucci committed Nov 28, 2017
1 parent 0ec6b65 commit 3d59800
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- job:
name: repoxplorer-unittests
parent: base
description: This is running the unittests for this project
run: playbooks/unittests.yaml
nodeset:
nodes:
- name: test-node
label: centos-oci

- project:
name: repoxplorer
check:
jobs:
- repoxplorer-unittests
gate:
jobs:
- repoxplorer-unittests
1 change: 1 addition & 0 deletions playbooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains only playbooks for repoxplorer testing in the CI.
24 changes: 24 additions & 0 deletions playbooks/unittests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- hosts: test-node
tasks:
- name: "Get workspace directory"
command: pwd
register: pwd_command
args:
chdir: "src/{{ zuul.project.canonical_hostname }}/"
- name: "Set workspace"
set_fact:
workspace: "{{ pwd_command.stdout }}"
- name: Extract ElasticSearch 2.4.0 archive
unarchive:
src: https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.0/elasticsearch-2.4.0.tar.gz
dest: "{{ workspace }}"
remote_src: yes
- name: Start ElasticSearch
command: "{{ workspace }}/elasticsearch-2.4.0/bin/elasticsearch -d"
- name: Get processes list
command: ps axf
- name: Run unit tests
command: tox
args:
chdir: "{{ zuul.project.src_dir }}/"
4 changes: 2 additions & 2 deletions repoxplorer/index/commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_filter(self, mails, repos, metadata,
filter["bool"]["must"].append(must_mail_clause)

must_project_clause = {
"bool": {
"bool": {
"should": []
}
}
Expand All @@ -204,7 +204,7 @@ def get_filter(self, mails, repos, metadata,
if paths:
for path in paths:
repo_clause["bool"]["must"][0]["bool"]["should"].append(
{"term": {"files_list": path}})
{"term": {"files_list": path}})

must_project_clause["bool"]["should"].append(repo_clause)

Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8
flake8>=3.3.0<3.4.0
nose
mock
coverage
Expand Down
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
envlist = py27,stats,pep8

[testenv]
basepython = /usr/bin/python2.7
basepython = python2.7
sitepackages = True
whitelist_externals =
nosetests
flake8
coverage
setenv =
PYTHONPATH = {envsitepackagesdir}
PECAN_CONFIG = repoxplorer/tests/config.py
deps =
-rtest-requirements.txt
Expand Down

0 comments on commit 3d59800

Please sign in to comment.