regression: 8789f9108 broke environment-variable preservation

Bug #1882542 reported by Eduardo Santiago
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bats (Ubuntu)
Fix Released
Undecided
Gioele Barabucci
Focal
New
Undecided
Unassigned
Jammy
New
Undecided
Unassigned
Kinetic
Won't Fix
Undecided
Unassigned

Bug Description

Commit 8789f910812afbf6b87dd371ee5ae30592f1423f ("support parallel execution of tests") broke existing BATS behavior in which a test file can set environment variables to be shared between subtests:

    if [ -z "$MYSTATE" ]; then
        do something
        export MYSTATE=something-to-be-used-by-all-tests
    fi

Attached is a reproducer. It passes in 8789f9108^ and, more importantly, bats-core.

Revision history for this message
Eduardo Santiago (ubuntu-le) wrote :
Revision history for this message
Eduardo Santiago (ubuntu-le) wrote :

Be sure to remove the statefile before invoking the reproducer:

    $ rm -f /tmp/mystate;/usr/local/bin/bats -t env-lost.bats
    1..2
    ok 1 first test
    # linecount is 2 (expected 1)
    not ok 2 second test
    # (in test file env-lost.bats, line 25)
    # `false' failed

Revision history for this message
Gioele Barabucci (gioele) wrote :

This issue has been fixed in bats 1.8.2.

Changed in bats (Ubuntu):
assignee: nobody → Gioele Barabucci (gioele)
status: New → Fix Committed
Shengjing Zhu (zhsj)
Changed in bats (Ubuntu):
status: Fix Committed → Fix Released
Shengjing Zhu (zhsj)
Changed in bats (Ubuntu Kinetic):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.