Skip to content

Commit 50e38e6

Browse files
authored
Merge pull request #1300 from okorach:it-improvement-2
Improve IT tests
2 parents 04ae722 + 61f5304 commit 50e38e6

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

test/it.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
# along with this program; if not, write to the Free Software Foundation,
1919
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2020
#
21-
set -euo pipefail
21+
22+
# set -euo pipefail
2223

2324
DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
2425
source "$DIR/test-tools.sh"
@@ -70,11 +71,6 @@ function tag_for {
7071
}
7172

7273
[ $# -eq 0 ] && echo "Usage: $0 <env1> [... <envN>]" && exit 1
73-
74-
REPO_ROOT="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; cd .. ; pwd -P )"
75-
TMP="$REPO_ROOT/tmp"
76-
IT_LOG_FILE="$TMP/it.log"
77-
mkdir -p "$TMP"
7874
rm -f "$TMP"/*.log "$TMP"/*.csv "$TMP"/*.json
7975

8076
noExport=0
@@ -182,8 +178,8 @@ do
182178
export SONAR_TOKEN="$SONAR_TOKEN_ADMIN_USER"
183179
logmsg "IT released tools $env"
184180
f="measures-$env-rel.csv"; run_test "$f" sonar-measures-export -b -m _main --withURL
185-
# sonar-measures-export -b -f "$f"
186181
f="findings-$env-rel.csv"; run_test "$f" sonar-findings-export
182+
# Breaks in version 3.3
187183
# f="audit-$env-rel.csv"; run_test "$f" sonar-audit -f "audit-$env-rel.csv"
188184
f="loc-$env-rel.csv"; run_test "$f" sonar-loc -n -a
189185
f="config-$env-rel.json"; run_test "$f" sonar-config -e
@@ -207,7 +203,7 @@ do
207203
test_passed_if_identical "$TMP/findings-$env-admin.csv" "$TMP/findings-$env-user.csv"
208204
if [ "$env" != "sonarcloud" ]; then
209205
logmsg "Deleting environment sonarId $id"
210-
sonar delete -i "$id"
206+
sonar delete -i "$id" 1>$IT_LOG_FILE 2>&1
211207
fi
212208
done
213209

test/test-tools.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ check_file_not_empty() {
7777
}
7878

7979
test_passed_if_identical() {
80-
diff $* >> $IT_LOG_FILE
81-
code=$?
80+
code=0
81+
diff $* >> $IT_LOG_FILE || code=$? || true
8282
test_result $code
8383
return $code
8484
}

0 commit comments

Comments
 (0)