|
| 1 | +Features introspection in e2e tests |
| 2 | +====================================== |
| 3 | + |
| 4 | +**Goal** |
| 5 | + |
| 6 | +Provide a way to identify the active features for every supported operator version. |
| 7 | + |
| 8 | +**Design** |
| 9 | + |
| 10 | +- Provide the possibility to group a set of tests that verify a common feature using ginkgo Label("feature:<topic>"). |
| 11 | + A Topic should describe the main feature being tested or the unique effect of the test on the cluster. For instance: |
| 12 | + `feature:schedrst`: indicates that the test is expected to restart the schedular, be it a pod restart or a complete removal of the scheduler and recreation. |
| 13 | + `feature:rtetols`: indicates that the test is testing the new feature RTE tolerations, which involves specific non-default configuration on the operator CRs hence functional effects. |
| 14 | + `feature:unsched`: indicates that the test workload is anticipated to be un-schedulable for any reason for example: insufficient resources (pod is pending), TAE (failed).. |
| 15 | + `feature:wlplacement`: indicates that the test challenges the scheduler to place a workload on a node. This is a common label for most of the functional tests. |
| 16 | + - Rules for creating a new topic |
| 17 | + - A topic should point out briefly the new feature being tested or the unique effect of the test on the cluster |
| 18 | + - The topic should be lowercase |
| 19 | + - For composite topics use `_` between the words, e.g no_nrt |
| 20 | + - Should not consist of any of `&|!,()/` |
| 21 | +- Define the list of supported features for each version. |
| 22 | +- Allow the user to list the supported features by adding new flag, `-inspect-features` which if passed the numaresources-operator binary on the controller pod will list the active features for the deployed version of the operator. |
| 23 | +- For automated bugs' scenarios that their fix is not back-ported to all versions use keywords tags that briefly describes the bug's main check. |
| 24 | + |
| 25 | +**List active features** |
| 26 | + |
| 27 | +Once the operator is installed, perform the following on the controller manager pod: |
| 28 | + |
| 29 | +```azure |
| 30 | +oc exec -it numaresources-controller-manager-95dd55c6-k6428 -n openshift-numaresources -- /bin/numaresources-operator --inspect-features |
| 31 | + ``` |
| 32 | + |
| 33 | +Example output: |
| 34 | +``` |
| 35 | +{"active":["config","nonreg","hostlevel","resacct","cache","stall","rmsched","rtetols","overhead","wlplacement","unsched","nonrt","taint","nodelabel","byres","tmpol"]} |
| 36 | +``` |
| 37 | + |
| 38 | +**Use case example: run tests for supported features only** |
| 39 | + |
| 40 | +To build the filter label query of the supported features on a specific version, a binary called `mkginkgolabelfilter` exists in `releases/support-tools` which expects a JSON input showing the supported features from the operator controller pod as follows: |
| 41 | + |
| 42 | +To use the helper tool perform the following: |
| 43 | + |
| 44 | +``` |
| 45 | +# curl -L -o mkginkgolabelfilter https://github.com/openshift-kni/numaresources-operator/releases/download/support-tools/mkginkgolabelfilter |
| 46 | +# chmod 755 mkginkgolabelfilter |
| 47 | +# ./mkginkgolabelfilter # This will wait to read the input which should be the output of the --inspect-features above |
| 48 | +{"active":["config","nonreg","hostlevel","resacct","cache","stall","rmsched","rtetols","overhead","wlplacement","unsched","nonrt","taint","nodelabel","byres","tmpol"]} |
| 49 | +feature: consistAny {config,nonreg,hostlevel,resacct,cache,stall,rmsched,rtetols,overhead,wlplacement,unsched,nonrt,taint,nodelabel,byres,tmpol} |
| 50 | +``` |
| 51 | + |
| 52 | +Then later in the podman command of running the tests use `--filter-label` with the output of the tool to run tests of supported features only. |
0 commit comments