Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: tests: Support skipping unsupported test with reason #14902

Merged
merged 5 commits into from
Aug 11, 2021

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Jul 9, 2021

Summary of changes

Fixes #14856

Add a new argument TEST_SKIPPED to mbed_greentea_add_test() to indicate a test is skipped and give a reason (e.g. the Mbed target and/or configuration does not provide what the test requires).

The skip reason of a test is printed when running tests with ctest, and the test is marked as "Skipped" in the test report.

As a showcase, use this mechanism to skip the PSA Attestation test if baremetal is used or PSA and Experimental API are unavailable. Also update the ticker test (whose CTest support was added in #14892) to skip if microsecond ticker is unavailable.

Impact of changes

Migration actions required

Documentation

In-line documentation for mbed_greentea_add_test() updated in tools/cmake/mbed_greentea.cmake.


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Got expected behaviors when trying to build the PSA Attestation test in platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS/attestation/test,

  • with/without -DMBED_TEST_BAREMETAL=ON
  • with/without --app-config <path-to>/mbed-os/TESTS/configs/experimental.json

Reviewers

@ARMmbed/mbed-os-core


@ciarmcom ciarmcom requested review from a team July 9, 2021 11:30
@ciarmcom
Copy link
Member

ciarmcom commented Jul 9, 2021

@LDong-Arm, thank you for your changes.
@ARMmbed/mbed-os-security @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@mergify
Copy link

mergify bot commented Jul 9, 2021

This PR cannot be merged due to conflicts. Please rebase to resolve them.

Copy link
Contributor

@rwalton-arm rwalton-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me. Just one comment about the log level of the skipped message.

tools/cmake/mbed_greentea.cmake Outdated Show resolved Hide resolved
rwalton-arm
rwalton-arm previously approved these changes Jul 14, 2021
@LDong-Arm
Copy link
Contributor Author

@rwalton-arm Thanks for the review.
To maintainers: Please keep CI on hold until #14892 is merged, and I'll make a further change with the PR rebased on that.

@mergify mergify bot added needs: CI and removed needs: work labels Jul 15, 2021
@Patater Patater self-requested a review July 15, 2021 10:26
tools/cmake/mbed_greentea.cmake Outdated Show resolved Hide resolved
@mergify mergify bot added needs: work and removed needs: CI labels Jul 15, 2021
@mergify mergify bot dismissed stale reviews from rwalton-arm and Patater July 15, 2021 10:55

Pull request has been modified.

Patater
Patater previously approved these changes Jul 15, 2021
@LDong-Arm LDong-Arm requested a review from a team August 11, 2021 10:52
@LDong-Arm
Copy link
Contributor Author

Rebased, as #14892 is merged

hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 11, 2021
Following approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea tests
are ported to enable running with CTest.
Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify bot added needs: CI and removed needs: review labels Aug 11, 2021
@Patater
Copy link
Contributor

Patater commented Aug 11, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 11, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_tfm-integration ✔️

@Patater Patater merged commit e588f80 into ARMmbed:master Aug 11, 2021
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 11, 2021
Following approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea tests
are ported to enable running with CTest.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 12, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/equeue requires MBED_EXTENDED_TESTS.
events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 13, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 13, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 13, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 13, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 20, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Aug 20, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Sep 18, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Sep 27, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
hazzlim added a commit to hazzlim/mbed-os that referenced this pull request Oct 2, 2021
Following the approach defined in ARMmbed#14892 and ARMmbed#14902, events greentea
tests are ported to enable running with CTest.

events/queue and events/timing both require DEVICE_USTICKER.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate how to skip unsupported tests with CTest
7 participants