#22 tests: port to tmt
Closed a year ago by xvitaly. Opened 2 years ago by jcheca.
rpms/ jcheca/pocl tests-port-to-tmt  into  rawhide

file added
+1
@@ -0,0 +1,1 @@ 

+ 1

@@ -0,0 +1,26 @@ 

+ summary: PoCL tests for build/PR gating without clang

+ adjust:

+   - because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."

+     when: >-

+       trigger is defined

+       and trigger != commit

+       and trigger != build

+     enabled: false

+ 

+ discover:

+     how: fmf

+     test: simple-opencl-no-clang

+ execute:

+     how: tmt

+ prepare:

+     # Programs linked against pocl should be able to run without clang installed,

+     # so when we run the test we want to make sure clang is not installed to

+     # verify we haven't introduced an implicit dependency on clang.

+     - name: Drop clang

+       how: shell

+       script: |

+         dnf erase -y clang

+ 

+ provision:

+   hardware:

+     memory: ">= 4 GiB"

@@ -0,0 +1,10 @@ 

+ summary: pocl test without clang

+ description:

+   Ensure that pocl doesn't have any depednencies with clang

+ tag:

+   - not-in-default

+ test: ./runtest.sh

+ require:

+   - ocl-icd-devel

+   - pocl

+   - gcc

@@ -1,4 +1,6 @@ 

  #include <stdio.h>

+ // malloc/free, EXIT_SUCCESS/EXIT_FAILURE

+ #include <stdlib.h>

  #include <string.h>

  #include <CL/cl.h>

  

file removed
-21
@@ -1,21 +0,0 @@ 

- - hosts: localhost

-   pre_tasks:

-   # Programs linked against pocl should be able to run without clang installed,

-   # so when we run the test we want to make sure clang is not installed to

-   # verify we haven't introduced an implicit dependency on clang.

-   - name: Uninstall clang

-     package:

-       name: clang

-       state: absent

-     tags: classic

-   roles:

-   - role: standard-test-basic

-     tags:

-       - classic

-     required_packages:

-       - ocl-icd-devel

-       - pocl

-       - gcc

-     tests:

-     # rhbz#1582884

-     - simple-opencl-no-clang:

clang runs simple-opencl-no-clang test on its gating. Since pocl tests are STI, we need to create a wrapper test in clang's repo which clones rpms/pocl repo, and runs the test script from simple-opencl-no-clang inside the cloned repo: https://src.fedoraproject.org/rpms/clang/blob/rawhide/f/tests/pocl

Having tmt support in this repo would allow us to import the test directly using tmt's features for remote tests.

Changes in this PR:

  • Initialized tmt in repo.
  • Ported simple-opencl-no-clang to tmt
  • Added fmf testplan for simple-opencl-no-clang
  • Fixed missing stdlib.h include in simple-opencl-no-clang, which was
    causing failures in aarch64, ppc64le, and s390x.

Tested in x86_64, ppc64le, aarch64 and s390x, all passing (previously, all but x86_64 failing due to missing stdlib import).
Example output of successful run:

$ tmt run -avv provision -h virtual -i fedora-rawhide                                                                            
/var/tmp/tmt/run-091          
Found 1 plan.

/tests/build-gating-no-clang
summary: PoCL tests for build/PR gating without clang
    discover
        how: fmf    
        directory: /home/jcheca/repos/fedpkgs/pocl
        hash: 50b764d
        tests: simple-opencl-no-clang
        summary: 1 test selected
            /tests/simple-opencl-no-clang
    provision
        how: virtual
        user: root
        key: []
        image: fedora-rawhide
        memory: 2048 MB
        disk: 10 GB
        connection: session
        arch: x86_64
        qcow: Fedora-Cloud-Base-Rawhide-20220830.n.0.x86_64.qcow2
        progress: downloading...
        name: tmt-091-AOTwOGKw
        progress: booting...
        ip: 127.0.0.1
        port: 10023
        distro: Fedora Linux 38 (Cloud Edition Prerelease)
        kernel: 6.0.0-0.rc3.25.fc38.x86_64
        summary: 1 guest provisioned
    prepare
        how: shell
        name: Drop clang
        overview: 1 script found
        script: dnf erase -y clang


        how: install
        summary: Install required packages
        name: requires
        package: 3 packages requested
            gcc
            ocl-icd-devel
            pocl

        summary: 2 preparations applied
    execute
        how: tmt
        exit-first: False
            test: pocl test without clang
                00:00:01 pass /tests/simple-opencl-no-clang [1/1]
        summary: 1 test executed
    report
        how: display
            pass /tests/simple-opencl-no-clang
                output.txt: /var/tmp/tmt/run-091/tests/build-gating-no-clang/execute/data/tests/simple-opencl-no-clang/output.txt
        summary: 1 test passed
    finish
        guest: stopped
        guest: removed
        summary: 0 tasks completed

total: 1 test passed

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Pull-Request has been closed by xvitaly

a year ago