Ran
|
Jobs
1
|
Files
40
|
Run time
3s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
log: Work around bash array `export` bug (again) While running the tests for `_GO_LOG_CONSOLE_FILTER` in the previous commit (part of #36), the tests would pass under Bash 4.4.5(1)-release, but not under Bash 3.2.57(1)-release. Eventually I traced down the fact that under 3.2.57(1)-release, `_GO_LOG_LEVELS` was getting erased sometime after the call to `assert_log_equals` and before the call to `assert_log_file_equals` causing `_@go.log_level_index` to fail for what should've been valid log level names. I reasoned that the `. "$_GO_USE_MODULES" 'log'` invocation in `assert_log_equals` was causing `_GO_LOG_LEVELS` (and likely other variables) to go out of scope after it returned, and since `$_GO_USE_MODULES` ensures a module is imported only once, that variable wasn't redefined—and there would've been errors with re-importing the module anyway due to `readonly` variables, as mentioned in commit 9c2ae73f7. Bash 4.4.5(1)-release didn't have this problem, and it started to ring familiar. After scanninng the repo history, I realized this is my second encounter with this bug, the first being documented in commit b421c7382. The bug is this: Declaring a global array and initializing it at the same time triggers a bug in some versions of bash 4.x prior to ~4.25 whereby it won't be visible outside the function in which it's declared after all. See: - https://lists.gnu.org/archive/html/bug-bash/2012-06/msg00068.html - ftp://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-025 - http://lists.gnu.org/archive/html/help-bash/2012-03/msg00078.html Though the above links mention `declare -g`, as did my original commit, it appears that `export` effectively triggers the same condition. This is not a bug Apple has fixed in their shipping 3.2.57(1)-release version of Bash. This is contrary to what I said in the earlier commit message, as I think at that point I hadn't run the tests locally as `PATH="/bin:$P... (continued)
1784 of 1892 relevant lines covered (94.29%)
135.22 hits per line
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 314.1 | 40 |
94.29 |
Travis Job 314.1 |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|