[PATCH mptcp-next] Squash to "selftests: mptcp: join: colored results"

Matthieu Baerts posted 1 patch 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20230728141833.916787-1-matthieu.baerts@tessares.net
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_lib.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH mptcp-next] Squash to "selftests: mptcp: join: colored results"
Posted by Matthieu Baerts 9 months, 1 week ago
New env var to force using colours.

Most CIs these days support colours in the serial but they will execute
scripts in a non interactive mode and colours will then not be displayed
by default. So we need a way to force displaying them when we are in
this mode:

  SELFTESTS_MPTCP_LIB_COLOR_FORCE=1

Note that it is still possible to force disabling them if needed via the
standard NO_COLOR=1 env var way.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---

Notes:
    to be squashed in "selftests: mptcp: join: colored results"

 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 1080d5d2430b..92a5befe8039 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -10,8 +10,9 @@ readonly KSFT_TEST=$(basename "${0}" | sed 's/\.sh$//g')
 
 MPTCP_LIB_SUBTESTS=()
 
-# only if supported and not disabled, see no-color.org
-if [ -t 1 ] && [ "${NO_COLOR:-}" != "1" ]; then
+# only if supported (or forced) and not disabled, see no-color.org
+if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } &&
+   [ "${NO_COLOR:-}" != "1" ]; then
 	readonly MPTCP_LIB_COLOR_RED="\E[1;31m"
 	readonly MPTCP_LIB_COLOR_GREEN="\E[1;32m"
 	readonly MPTCP_LIB_COLOR_YELLOW="\E[1;33m"

base-commit: 18d38b0f6b8f3d12bbd55c179b87d3ab014fef48
-- 
2.40.1
Re: [PATCH mptcp-next] Squash to "selftests: mptcp: join: colored results"
Posted by Mat Martineau 9 months, 1 week ago
On Fri, 28 Jul 2023, Matthieu Baerts wrote:

> New env var to force using colours.
>
> Most CIs these days support colours in the serial but they will execute
> scripts in a non interactive mode and colours will then not be displayed
> by default. So we need a way to force displaying them when we are in
> this mode:
>
>  SELFTESTS_MPTCP_LIB_COLOR_FORCE=1
>
> Note that it is still possible to force disabling them if needed via the
> standard NO_COLOR=1 env var way.
>
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
>
> Notes:
>    to be squashed in "selftests: mptcp: join: colored results"
>

Looks ok to squash, thanks Matthieu.


> tools/testing/selftests/net/mptcp/mptcp_lib.sh | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> index 1080d5d2430b..92a5befe8039 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
> @@ -10,8 +10,9 @@ readonly KSFT_TEST=$(basename "${0}" | sed 's/\.sh$//g')
>
> MPTCP_LIB_SUBTESTS=()
>
> -# only if supported and not disabled, see no-color.org
> -if [ -t 1 ] && [ "${NO_COLOR:-}" != "1" ]; then
> +# only if supported (or forced) and not disabled, see no-color.org
> +if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } &&
> +   [ "${NO_COLOR:-}" != "1" ]; then
> 	readonly MPTCP_LIB_COLOR_RED="\E[1;31m"
> 	readonly MPTCP_LIB_COLOR_GREEN="\E[1;32m"
> 	readonly MPTCP_LIB_COLOR_YELLOW="\E[1;33m"
>
> base-commit: 18d38b0f6b8f3d12bbd55c179b87d3ab014fef48
> -- 
> 2.40.1
>
>
>
Re: Squash to "selftests: mptcp: join: colored results": Tests Results
Posted by MPTCP CI 9 months, 1 week ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5430554259095552
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5430554259095552/summary/summary.txt

- KVM Validation: debug (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/4726866817318912
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/4726866817318912/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5852766724161536
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5852766724161536/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6556454165938176
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6556454165938176/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/2db7493f2845


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)