From: pmikus Date: Fri, 20 Aug 2021 05:04:09 +0000 (+0000) Subject: Tox: Remove obsolete checkers X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=5b98ebf4ea91b11c3316f4251c5b99f00910a465 Tox: Remove obsolete checkers + coverage is not used + naming is now covered fully by suitegen which can be improved to do detections of packet encapsulations Signed-off-by: pmikus Change-Id: I9631988e144d3878a6b146214e3aea75694ebf3f --- diff --git a/resources/libraries/bash/entry/check/tc_coverage.sh b/resources/libraries/bash/entry/check/tc_coverage.sh deleted file mode 100644 index 66afbb45cf..0000000000 --- a/resources/libraries/bash/entry/check/tc_coverage.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -xeuo pipefail - -# This file should be executed from tox, as the assumend working directory -# is different from where this file is located. -# This file does not have executable flag nor shebang, -# to dissuade non-tox callers. - -# "set -eu" handles failures from the following two lines. -BASH_CHECKS_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))" -BASH_FUNCTION_DIR="$(readlink -e "${BASH_CHECKS_DIR}/../../function")" -source "${BASH_FUNCTION_DIR}/common.sh" || { - echo "Source failed." >&2 - exit 1 -} - -# Grep of interest: We want all tc01- prefixed (skip TC variations for now). -# Currently script assumes all variations inside to be part of either -# auto-generation or not checked at all (VIRL derivates). -r_grep="tc01-" -# Parse grep of interest (learn path, learn suite, learn testcase name). -r_parse='(.*)\/(.*).robot.*(tc[[:digit:]]{2}-.*)' - -rm -f "tc_coverage.log" || die - -# Disabling -x: Following lines are doing too much garbage output. -set +x - -# Grep interest. -grep_match=$(grep -RE "${r_grep}" tests/*) || die -# Extract data from the grep output. -suites_dirs=($(printf "${grep_match}" | sed -re "s/${r_parse}/\1/")) || die -suites_names=($(printf "${grep_match}" | sed -re "s/${r_parse}/\2/")) || die -testcases_names=($(printf "${grep_match}" | sed -re "s/${r_parse}/\3/")) || die - -# Extract 2N suites from the global testcase list and normalize output. -suites_2n=($(printf '%s\n' "${suites_names[@]}" | \ - grep -E "^(2n1l|2n)-" | \ - sed -re "s/(2n1l|2n)-//")) -# Extract 3N suites from the global testcase list. -suites_3n=($(printf '%s\n' "${suites_names[@]}" | \ - grep -vE "^(2n1l|2n|eth2p)-")) -# Extract vpp_device suites from the global testcase list. -# Code will try to map the naming to perf by normalizing output. -suites_dev=($(printf '%s\n' "${suites_names[@]}" | \ - grep -E "^eth2p-" | \ - sed -re "s/eth2p-/10ge2p1x710-/" | \ - sed -re "s/-dev/-ndrpdr/" | \ - sed -re "s/-ethicmpv/-ethip/")) - -# Compute intersection of arrays. -intersection_3n2n=($(comm -12 <(printf '%s\n' "${suites_3n[@]}" | sort) \ - <(printf '%s\n' "${suites_2n[@]}" | sort))) -intersection_3ndev=($(comm -12 <(printf '%s\n' "${suites_2n[@]}" | sort) \ - <(printf '%s\n' "${suites_dev[@]}" | sort))) - -# Print the results in CSV format. -echo "Suite name;Testcase name;2n version;VPP Device version" \ - > tc_coverage.log -for i in "${!suites_names[@]}"; do - if [[ ! "${suites_names[i]}" =~ ^(2n1l|2n|eth2p)-.* ]]; then - echo -n "${suites_names[i]};${testcases_names[i]}" \ - >> tc_coverage.log - if [[ "${intersection_3n2n[@]}" =~ "${suites_names[i]}" ]]; then - echo -n ";yes" >> tc_coverage.log - else - echo -n ";no" >> tc_coverage.log - fi - if [[ "${intersection_3ndev[@]}" =~ "${suites_names[i]}" ]]; then - echo ";yes" >> tc_coverage.log - else - echo ";no" >> tc_coverage.log - fi - fi -done - -set -x - -echo "Count 2n: ${#suites_2n[@]}" -echo "Count 3n: ${#suites_3n[@]}" -echo "Count dev: ${#suites_dev[@]}" -echo "Coverage 2n3n: ${#intersection_3n2n[@]}" -echo "Coverage 3ndev: ${#intersection_3ndev[@]}" - -warn -warn "Testcase coverage checker: PASS" diff --git a/tox.ini b/tox.ini index e8b28f029b..3783bba4ff 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ [tox] # Fast and brief checkers to front, slow or verbose checkers to back. -envlist = job_spec, tc_naming, tc_coverage, copyright_year, gpl_license, +envlist = job_spec, copyright_year, gpl_license, new_line_length, line_length, autogen, pylint, doc_verify # The following is needed as tox requires setup.py by default. @@ -95,18 +95,6 @@ deps = whitelist_externals = /bin/bash commands = bash {[tox]checker_dir}/pylint.sh -# TODO: See FIXME in https://gerrit.fd.io/r/16423 - -[testenv:tc_coverage] -# Coverage is not needed to be voting. -ignore_outcome = true -whitelist_externals = /bin/bash -commands = bash {[tox]checker_dir}/tc_coverage.sh - -[testenv:tc_naming] -whitelist_externals = /bin/bash -commands = bash {[tox]checker_dir}/tc_naming.sh - # Keep testenvs sorted alphabetically, please. # TODO: Add a checker against unresolved merge conflicts.