summaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/fixtures/case.json14
-rw-r--r--tests/integration/fixtures/pod.json6
-rw-r--r--tests/integration/fixtures/project.json4
-rw-r--r--tests/integration/group_vars/all1
-rw-r--r--tests/integration/host_vars/localhost7
-rw-r--r--tests/integration/run.yaml30
-rw-r--r--tests/integration/setup.yaml22
7 files changed, 83 insertions, 1 deletions
diff --git a/tests/integration/fixtures/case.json b/tests/integration/fixtures/case.json
new file mode 100644
index 00000000..22abc40f
--- /dev/null
+++ b/tests/integration/fixtures/case.json
@@ -0,0 +1,14 @@
+{
+ "run": "",
+ "name": "compute",
+ "ci_loop": "",
+ "tags": "",
+ "url": "",
+ "domains": "",
+ "dependencies": "",
+ "version": "",
+ "criteria": "",
+ "tier": "",
+ "blocking": "",
+ "description": ""
+} \ No newline at end of file
diff --git a/tests/integration/fixtures/pod.json b/tests/integration/fixtures/pod.json
new file mode 100644
index 00000000..8c2863ba
--- /dev/null
+++ b/tests/integration/fixtures/pod.json
@@ -0,0 +1,6 @@
+{
+ "details": "",
+ "role": "",
+ "name": "internal",
+ "mode": ""
+} \ No newline at end of file
diff --git a/tests/integration/fixtures/project.json b/tests/integration/fixtures/project.json
new file mode 100644
index 00000000..ecd03e83
--- /dev/null
+++ b/tests/integration/fixtures/project.json
@@ -0,0 +1,4 @@
+{
+ "name": "qtip",
+ "description": "Platform Performance Benchmarking"
+} \ No newline at end of file
diff --git a/tests/integration/group_vars/all b/tests/integration/group_vars/all
index 7c56f570..16a93f46 100644
--- a/tests/integration/group_vars/all
+++ b/tests/integration/group_vars/all
@@ -1,2 +1,3 @@
qtip_resources: ../../resources
qtip_reports: ./reports
+qtip_fixtures: ./fixtures
diff --git a/tests/integration/host_vars/localhost b/tests/integration/host_vars/localhost
new file mode 100644
index 00000000..18d764cc
--- /dev/null
+++ b/tests/integration/host_vars/localhost
@@ -0,0 +1,7 @@
+testapi_url: http://localhost:8000/api/v1
+project_name: qtip
+case_name: compute
+pod_name: internal
+installer: fuel
+version: master
+scenario: demo
diff --git a/tests/integration/run.yaml b/tests/integration/run.yaml
index 86b36284..7545a65e 100644
--- a/tests/integration/run.yaml
+++ b/tests/integration/run.yaml
@@ -33,7 +33,15 @@
delegate_to: localhost
tags: [calculate]
+- hosts: local
+ tasks:
+ - name: aggregate QPI results from all tested nodes
+ aggregate:
+ group: compute
+ register: pod_result
+
# Generate and publish report
+
- hosts: local
tasks:
- name: create report folder
@@ -49,4 +57,24 @@
src: "{{ qtip_resources }}/template/qpi-report.j2"
dest: "{{ qtip_reports }}/qpi-report"
tags: [report]
- # TODO(yujunz) push test result to testapi
+ - name: push result to testapi
+ uri:
+ url: "{{ testapi_url }}/results"
+ body: "{{ item|to_json }}"
+ method: POST
+ body_format: json
+ status_code: 200
+ with_items:
+ -
+ project_name: "{{ project_name }}"
+ case_name: "{{ case_name }}"
+ pod_name: "{{ pod_name }}"
+ installer: "{{ installer }}"
+ version: "{{ version }}"
+ scenario: "{{ scenario }}"
+ start_date: "{{ ansible_date_time.date }}"
+ stop_date: "{{ ansible_date_time.date }}"
+ criteria: ""
+ details: " {{ pod_result }}"
+
+ tags: [testapi]
diff --git a/tests/integration/setup.yaml b/tests/integration/setup.yaml
index 4af9a129..8d055c23 100644
--- a/tests/integration/setup.yaml
+++ b/tests/integration/setup.yaml
@@ -19,3 +19,25 @@
- name: update ssh.cfg file
template: src={{ qtip_resources }}/template/ssh.cfg.j2 dest=./ssh.cfg
delegate_to: localhost
+
+# Initialize testapi database
+- hosts: localhost
+ tasks:
+ - name: create project and pod
+ uri:
+ url: "{{ testapi_url }}/{{item}}s"
+ method: POST
+ body: "{{ lookup('file', '{}/{}.json'.format(qtip_fixtures, item)) }}"
+ status_code: [200, 403]
+ body_format: json
+ with_items:
+ - project
+ - pod
+ - name: create cases
+ uri:
+ url: "{{ testapi_url }}/projects/qtip/cases"
+ method: POST
+ body: "{{ lookup('file', '{}/case.json'.format(qtip_fixtures)) }}"
+ status_code: [200, 403]
+ body_format: json
+ tags: [testapi]