QChris has uploaded a new change for review.
https://gerrit.wikimedia.org/r/102299
Change subject: Use WORKSPACE variable to determine $__CODE_BASE in fallback
......................................................................
Use WORKSPACE variable to determine $__CODE_BASE in fallback
It was hard to run the tests locally on a non-wmf machine, as
$__CODE_BASE defaulted to "/a/...". Hence, we now generalize the
Jenkins case and build $__CODE_BASE from the WORKSPACE environment
variable. Thereby, it should be possible to rune the tests an
non-gallium Jenkins slaves.
Change-Id: I2ba2c3e4ba829dd36017aa6ab9c303536e445662
---
M squids/t/03-regression-wrong-domains-actually-ipv6.t
M squids/t/CommonConfig.pm
2 files changed, 13 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats
refs/changes/99/102299/1
diff --git a/squids/t/03-regression-wrong-domains-actually-ipv6.t
b/squids/t/03-regression-wrong-domains-actually-ipv6.t
index bef8d01..3e1bb81 100644
--- a/squids/t/03-regression-wrong-domains-actually-ipv6.t
+++ b/squids/t/03-regression-wrong-domains-actually-ipv6.t
@@ -95,6 +95,10 @@
our $__DATA_BASE;
+# Making sure $__DATA_BASE identification worked (i.e.: it is a
+# directory), as otherwise creating files will fail badly and not give
+# much hints what wehn wrong.
+ok(-d $__DATA_BASE, '$__DATA_BASE points to directory');
################################
# Creating input for test
diff --git a/squids/t/CommonConfig.pm b/squids/t/CommonConfig.pm
index 367e5e9..bcede39 100644
--- a/squids/t/CommonConfig.pm
+++ b/squids/t/CommonConfig.pm
@@ -16,10 +16,7 @@
chomp $hostname;
our $__CODE_BASE;
-if($hostname eq "gallium") {
- # Running on Jenkins
- $__CODE_BASE = $ENV{WORKSPACE}."/squids";
-} elsif($hostname eq "stat1" && $ENV{HOME} eq "/home/ezachte") {
+if($hostname eq "stat1" && $ENV{HOME} eq "/home/ezachte") {
# Running on Erik's account on stat1
$__CODE_BASE = "/home/ezachte/wikistats/squids";
} elsif($hostname eq "stat1" && $ENV{HOME} eq "/home/diederik") {
@@ -29,7 +26,14 @@
$__CODE_BASE = "/home/travis/build/wsdookadr/analytics-wikistats/squids";
} else {
# Anywhere else
- $__CODE_BASE = "/a/wikistats_git/squids";
+
+ # If WORKSPACE seems to point to a checkout, we use it (Allowing for
+ # easier local testing, and use through Jenkins). Otherwise we fall
+ # back to the usual wmf setup.
+ $__CODE_BASE = $ENV{WORKSPACE}."/squids";
+ if(! -d $__CODE_BASE) {
+ $__CODE_BASE = "/a/wikistats_git/squids";
+ }
};
--
To view, visit https://gerrit.wikimedia.org/r/102299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ba2c3e4ba829dd36017aa6ab9c303536e445662
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats
Gerrit-Branch: master
Gerrit-Owner: QChris <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits