|
| 1 | +# Environment variables check block |
| 2 | + |
| 3 | +- set_fact: |
| 4 | + github_username: "{{ lookup('ansible.builtin.env','GITHUB_USERNAME') }}" |
| 5 | + github_personal_access_token: "{{ lookup('ansible.builtin.env','GITHUB_ACCESS_TOKEN') }}" |
| 6 | + |
| 7 | +- fail: |
| 8 | + msg: "Please set openshift_test_private_e2e_repo variable with the e2e repo URL." |
| 9 | + when: openshift_test_private_e2e_repo == "" or openshift_test_private_e2e_repo == None |
| 10 | + |
| 11 | +# Cluster health check |
| 12 | +- name: Invoke the role check-cluster-health to check cluster status |
| 13 | + include_role: |
| 14 | + name: check-cluster-health |
| 15 | + |
| 16 | +# openshift-test-private e2e run block |
| 17 | +- name: Validate openshift-test-private |
| 18 | + block: |
| 19 | + - fail: |
| 20 | + msg: "Please set the environment variables GITHUB_USERNAME and GITHUB_ACCESS_TOKEN" |
| 21 | + when: github_username == "" and github_personal_access_token == "" |
| 22 | + |
| 23 | + - name: Include role for installation of Go lang |
| 24 | + include_role: |
| 25 | + name: golang-installation |
| 26 | + vars: |
| 27 | + go_tarball: "{{ openshift_test_private_golang_tarball }}" |
| 28 | + golang_path: "/usr/local" |
| 29 | + |
| 30 | + - name: Create openshift-test-private working directory |
| 31 | + file: |
| 32 | + path: "{{ openshift_test_private_directory }}" |
| 33 | + state: directory |
| 34 | + mode: '0755' |
| 35 | + |
| 36 | + - name: Clone openshift-test-private repo |
| 37 | + git: |
| 38 | + repo: "https://{{ github_username }}:{{ github_personal_access_token }}@github.com/{{ openshift_test_private_e2e_repo | urlsplit('path') }}" |
| 39 | + dest: "{{ openshift_test_private_directory }}/openshift-tests-private" |
| 40 | + version: "{{ openshift_test_private_git_branch }}" |
| 41 | + force: true |
| 42 | + |
| 43 | + - name: Run make build command at target |
| 44 | + shell: make |
| 45 | + environment: "{{ openshift_test_private_env }}" |
| 46 | + args: |
| 47 | + chdir: "{{ openshift_test_private_directory }}/openshift-tests-private" |
| 48 | + |
| 49 | + - name: Check if the binary is created |
| 50 | + shell: ls -hl {{ openshift_test_private_directory }}/openshift-tests-private/bin/extended-platform-tests | wc -l |
| 51 | + args: |
| 52 | + chdir: "{{ openshift_test_private_directory }}/openshift-tests-private" |
| 53 | + register: bin_output |
| 54 | + failed_when: bin_output.stdout|int != 1 |
| 55 | + |
| 56 | + - name: Run the e2e test command for all |
| 57 | + shell: ./bin/extended-platform-tests run all --dry-run | |
| 58 | + ./bin/extended-platform-tests run -f - -o ../all-tests-logs.txt |
| 59 | + when: not testcase_filters |
| 60 | + args: |
| 61 | + chdir: "{{ openshift_test_private_directory }}/openshift-tests-private" |
| 62 | + environment: "{{ openshift_test_private_env }}" |
| 63 | + |
| 64 | + - name: Run the e2e test command for multiple filters |
| 65 | + shell: ./bin/extended-platform-tests run all --dry-run | grep "{{ testcase_filters }}" | |
| 66 | + ./bin/extended-platform-tests run -f - -o ../multi-filter-tests-logs.txt |
| 67 | + when: testcase_filters |
| 68 | + args: |
| 69 | + chdir: "{{ openshift_test_private_directory }}/openshift-tests-private" |
| 70 | + environment: "{{ openshift_test_private_env }}" |
| 71 | + |
| 72 | + when: openshift_test_private_validation |
0 commit comments