Skip to content

Commit aab6c7d

Browse files
committed
check-build-and-verify.sh: rewrite sed script on Perl.
It turned out that `sed` from Travis CI doesn't support -z option. Should be in feea131 commit. Addressed to #538
1 parent feea131 commit aab6c7d

File tree

3 files changed

+45
-27
lines changed

3 files changed

+45
-27
lines changed

src/main/scripts/ci/check-build-and-verify.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
5858
mvn --batch-mode findbugs:check >findbugs.log 2>&1 || FINDBUGS_FAIL=yes
5959
fi
6060

61-
mvn --batch-mode verify -Denforcer.skip=true -DskipUnitTests=true >verify.log 2>&1 || VERIFY_FAIL=yes
61+
mvn --batch-mode verify -Denforcer.skip=true -DskipUnitTests=true >verify-raw.log 2>&1 || VERIFY_FAIL=yes
62+
63+
# Workaround for #538
64+
"$(dirname "$0")/filter-out-htmlunit-messages.pl" <verify-raw.log >verify.log
6265

6366
echo
6467
echo 'Build summary:'
@@ -100,7 +103,7 @@ fi
100103

101104
print_log verify.log 'Run integration tests'
102105

103-
rm -f cs.log pmd.log codenarc.log license.log pom.log bootlint.log rflint.log jasmine.log validator.log enforcer.log test.log findbugs.log verify.log
106+
rm -f cs.log pmd.log codenarc.log license.log pom.log bootlint.log rflint.log jasmine.log validator.log enforcer.log test.log findbugs.log verify-raw.log verify.log
104107

105108
if [ -n "$CS_FAIL$PMD_FAIL$CODENARC_FAIL$LICENSE_FAIL$POM_FAIL$BOOTLINT_FAIL$RFLINT_FAIL$JASMINE_FAIL$HTML_FAIL$ENFORCER_FAIL$TEST_FAIL$FINDBUGS_FAIL$VERIFY_FAIL" ]; then
106109
exit 1
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/perl
2+
#
3+
# This script is filtering out log messages from htmlunit.
4+
# It's a workaround for https://github.com/php-coder/mystamps/issues/538
5+
#
6+
7+
use strict;
8+
use warnings;
9+
10+
my @regexps = (
11+
# [WARNING] CSS error: 'http://127.0.0.1:8081/public/bootstrap/3.3.7/css/bootstrap.min.css' [5:56298] Error in expression; ':' found after identifier "progid".
12+
qr/\[WARNING\] CSS error: '[^']+' \[[^]]+\] Error in expression; [^\.]+\.\n/,
13+
14+
# [WARNING] CSS error: 'http://127.0.0.1:8081/public/bootstrap/3.3.7/css/bootstrap.min.css' [5:115558] Invalid color "#000\9".
15+
qr/\[WARNING\] CSS error: '[^']+' \[[^]]+\] Invalid color "[^"]+"\.\n/,
16+
17+
# [WARNING] CSS error: 'http://127.0.0.1:8081/public/selectize/0.12.3/css/selectize.bootstrap3.css' [176:3] Error in declaration. '*' is not allowed as first char of a property.
18+
qr/\[WARNING\] CSS error: '[^']+' \[[^]]+\] Error in declaration\. '\*' is not allowed as first char of a property\.\n/,
19+
20+
# [ERROR] runtimeError: message=[An invalid or illegal selector was specified (selector: '*,:x' error: Invalid selector: :x).] sourceName=[http://127.0.0.1:8081/public/jquery/1.9.1/jquery.min.js] line=[4] lineSource=[null] lineOffset=[0]
21+
qr/\[ERROR\] runtimeError: message=\[[^]]+\] sourceName=\[[^]]+\] line=\[[^]]+\] lineSource=\[[^]]+\] lineOffset=\[[^]]+\]\n/,
22+
23+
# [ERROR] runtimeError: message=[An invalid or illegal selector was specified (selector: '[id='sizzle-1487943406281'] [data-selectable]:first' error: Invalid selector: [id="sizzle-1487943406281"] [data-selectable]:first).] sourceName=[http://127.0.0.1:8081/public/jquery/1.9.1/jquery.min.js] line=[4] lineSource=[null] lineOffset=[0]
24+
qr/\[ERROR\] runtimeError: message=\[[^\(]+\(selector: '\[id='sizzle-[^']+'\] \[data-selectable\]:first' error: Invalid selector: \[id="sizzle-[^"]+"\] \[data-selectable\]:first\)\.\] sourceName=\[[^]]+\] line=\[[^]]+\] lineSource=\[[^]]+\] lineOffset=\[[^]]+\]\n/,
25+
26+
# [INFO] Bad input type: "url", creating a text input
27+
qr/\[INFO\] Bad input type: "url", creating a text input\n/
28+
);
29+
30+
foreach my $line (<STDIN>) {
31+
foreach my $regexp (@regexps) {
32+
my $count = $line =~ s/$regexp//;
33+
if ($count > 0) {
34+
# replacement were performed, skip other regexps
35+
last;
36+
}
37+
}
38+
39+
print $line;
40+
}

src/main/scripts/ci/ignore-htmlunit-messages.sed

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)