Skip to content

Commit fe50aed

Browse files
committed
testsuite: skip tests that use COLUMNS if value not preserved
Problem: A couple tests in the testsuite explicitly set the COLUMNS environment variable to ensure the output of a command responds to changes in the terminal width. However, in some environments the flux(1) libtool wrapper script can reset this variable, causing the tests to erroneously fail. Use the provided test_columns_variable_preserved() function to check for the required behavior of this variable, and skip the tests if not.
1 parent 2d5beca commit fe50aed

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

t/t1000-kvs.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,8 @@ test_expect_success 'kvs: ls -w40 adjusts output width to 40' '
681681
EOF
682682
test_cmp expected output
683683
'
684-
test_expect_success 'kvs: ls with COLUMNS=20 adjusts output width to 20' '
684+
test_columns_variable_preserved && test_set_prereq USE_COLUMNS
685+
test_expect_success USE_COLUMNS 'kvs: ls with COLUMNS=20 adjusts output width to 20' '
685686
flux kvs unlink -Rf $DIR &&
686687
${FLUX_BUILD_DIR}/t/kvs/dtree -p$DIR -h1 -w50 &&
687688
COLUMNS=20 flux kvs ls $DIR | wc -wl >output &&

t/t2803-flux-pstree.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ test_expect_success 'flux-pstree -a works' '
149149
EOF
150150
test_cmp ${name}.expected ${name}.output
151151
'
152-
test_expect_success 'flux-pstree truncates at COLUMNS' '
152+
test_columns_variable_preserved && test_set_prereq USE_COLUMNS
153+
test_expect_success USE_COLUMNS 'flux-pstree truncates at COLUMNS' '
153154
name="truncated" &&
154155
COLUMNS=16 flux pstree -a > ${name}.output &&
155156
test_debug "cat ${name}.output" &&

0 commit comments

Comments
 (0)