Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
97401b9e
Unverified
Commit
97401b9e
authored
Mar 17, 2020
by
Steven Allen
Committed by
GitHub
Mar 17, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6997 from ipfs/chore/sharness_fixes_2019-03-16
Chore/sharness fixes 2019 03 16
parents
4acb15d5
51d4383d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
bin/test-go-fmt
bin/test-go-fmt
+4
-1
test/sharness/lib/test-lib.sh
test/sharness/lib/test-lib.sh
+41
-0
No files found.
bin/test-go-fmt
View file @
97401b9e
#!/usr/bin/env bash
#!/usr/bin/env bash
set
-euo
pipefail
set
-euo
pipefail
T
=
"
$(
mktemp
)
"
T
=
"
$(
mktemp
)
"
find
.
-name
'*.go'
'!'
-path
./plugin/loader/preload.go | xargs gofmt
-l
>
"
$T
"
find
.
\
-path
./test/sharness
-prune
\
-o
-path
./plugin/loader/preload.go
-prune
\
-o
-name
'*.go'
-print0
| xargs
-0
gofmt
-l
>
"
$T
"
if
[
-n
"
$(
cat
$T
)
"
]
;
then
if
[
-n
"
$(
cat
$T
)
"
]
;
then
echo
"Following Go code is not formatted."
echo
"Following Go code is not formatted."
...
...
test/sharness/lib/test-lib.sh
View file @
97401b9e
...
@@ -41,6 +41,47 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
...
@@ -41,6 +41,47 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
# Please put go-ipfs specific shell functions below
# Please put go-ipfs specific shell functions below
###
# BEGIN Check for pre-existing daemon being stuck
###
wait_prev_cleanup_tick_secs
=
1
wait_prev_cleanup_max_secs
=
5
cur_test_pwd
=
"
$(
pwd
)
"
while
true
;
do
echo
-n
>
stuck_cwd_list
lsof
-c
ipfs
-Ffn
2>/dev/null |
grep
-A1
'^fcwd$'
|
grep
'^n'
|
cut
-b
2- |
while
read
-r
pwd_of_stuck
;
do
case
"
$pwd_of_stuck
"
in
"
$cur_test_pwd
"
*
)
echo
"
$pwd_of_stuck
"
>>
stuck_cwd_list
;;
*
)
;;
esac
done
test
-s
stuck_cwd_list
||
break
test
"
$wait_prev_cleanup_max_secs
"
-le
0
&&
break
echo
"Daemons still running, waiting for
${
wait_prev_cleanup_max_secs
}
s"
sleep
$wait_prev_cleanup_tick_secs
wait_prev_cleanup_max_secs
=
"
$((
$wait_prev_cleanup_max_secs
-
$wait_prev_cleanup_tick_secs
))
"
done
if
test
-s
stuck_cwd_list
;
then
test_expect_success
"ipfs daemon (s)seems to be running with CWDs of
$(
cat
stuck_cwd_list
)
Almost certainly a leftover from a prior test, ABORTING"
'false'
test_done
fi
###
# END Check for pre-existing daemon being stuck
###
# Make sure the ipfs path is set, also set in test_init_ipfs but that
# Make sure the ipfs path is set, also set in test_init_ipfs but that
# is not always used.
# is not always used.
export
IPFS_PATH
=
"
$(
pwd
)
/.ipfs"
export
IPFS_PATH
=
"
$(
pwd
)
/.ipfs"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment