Skip to content

Commit e21f1a9

Browse files
committed
comment test_files_api
1 parent ae30699 commit e21f1a9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/sharness/t0250-files-api.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,21 @@ test_sharding() {
106106
'
107107
}
108108

109+
# Some loose notes:
110+
# Using `/cats` as the root directory where tests work.
109111
test_files_api() {
110112
local EXTRA ARGS RAW_LEAVES
113+
# Textual information used in output log.
111114
EXTRA=$1
115+
# Used in `ipfs files write` and `ipfs files mkdir`:
116+
# * `--cid-version=1`
112117
ARGS=$2
118+
# `--raw-leaves` option for `ipfs files write`.
113119
RAW_LEAVES=$3
114120

121+
# Create and verify the directory `/cats` where the tests will be
122+
# working on.
123+
115124
test_expect_success "can mkdir in root $EXTRA" '
116125
ipfs files mkdir $ARGS /cats
117126
'
@@ -181,6 +190,8 @@ test_files_api() {
181190
ipfs files stat --hash / > roothashafter &&
182191
test_cmp roothash roothashafter
183192
'
193+
# Create files ($FILE1/2/3) inside the `/cats` directory and
194+
# also inside subdirectories.
184195

185196
test_expect_success "can put files into directory $EXTRA" '
186197
ipfs files cp /ipfs/$FILE1 /cats/file1
@@ -498,12 +509,19 @@ test_files_api() {
498509
echo "testing" | ipfs files write $ARGS $RAW_LEAVES -f=false -e /cats/walrus
499510
'
500511

512+
# Offending test: https://github.com/ipfs/go-ipfs/issues/8131
501513
test_expect_success "root hash not bubbled up yet $EXTRA" '
502514
test -z "$ONLINE" ||
503515
(ipfs refs local > refsout &&
504516
test_expect_code 1 grep $ROOT_HASH refsout)
505517
'
506518

519+
# FIXME: Does this mean the stat is supposed to flush this?
520+
# The stat code seems to be an ad-hoc tool that works on the UnixFS
521+
# layer and not on the MFS one that handles flushing.
522+
# Maybe the MFS lookup function that ends up calling
523+
# `(*mfs.Directory).GetNode()` and then `(*Directory).sync()`.
524+
# This is not exactly the same as `(*Directory).Flush()`.
507525
test_expect_success "changes bubbled up to root on inspection $EXTRA" '
508526
ipfs files stat --hash / > root_hash
509527
'

0 commit comments

Comments
 (0)