mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
Merge pull request #2332 from ipfs/appveyor-fixes
appveyor: sharness improvements
This commit is contained in:
10
appveyor.yml
10
appveyor.yml
@ -12,8 +12,8 @@ clone_folder: c:\go\src\github.com\ipfs\go-ipfs
|
||||
|
||||
environment:
|
||||
GOPATH: c:\gopath
|
||||
TEST_VERBOSE: 1
|
||||
#TEST_NO_FUSE: 1
|
||||
#TEST_VERBOSE: 1
|
||||
#TEST_SUITE: test_sharness_expensive
|
||||
#GOFLAGS: -tags nofuse
|
||||
global:
|
||||
@ -40,10 +40,10 @@ install:
|
||||
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
|
||||
#
|
||||
build_script:
|
||||
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make nofuse"'
|
||||
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; make nofuse"'
|
||||
|
||||
test_script:
|
||||
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export GOFLAGS=''-tags nofuse''; export TEST_NO_FUSE=1; export TEST_VERBOSE=1; export TEST_SUITE=test_sharness_expensive; make $TEST_SUITE"'
|
||||
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; export GOFLAGS=''-tags nofuse''; export TEST_NO_FUSE=1; export TEST_VERBOSE=1; export TEST_SUITE=test_sharness_expensive; make $TEST_SUITE"'
|
||||
|
||||
build:
|
||||
parallel: true
|
||||
#build:
|
||||
# parallel: true
|
||||
|
@ -23,6 +23,14 @@ test_sort_cmp() {
|
||||
test_cmp "$1_sorted" "$2_sorted"
|
||||
}
|
||||
|
||||
# Same as test_cmp above, but we standardize directory
|
||||
# separators before comparing the files.
|
||||
test_path_cmp() {
|
||||
sed -e "s/\\\\/\//g" "$1" >"$1_std" &&
|
||||
sed -e "s/\\\\/\//g" "$2" >"$2_std" &&
|
||||
test_cmp "$1_std" "$2_std"
|
||||
}
|
||||
|
||||
# Quote arguments for sh eval
|
||||
shellquote() {
|
||||
_space=''
|
||||
|
@ -44,10 +44,14 @@ test "$TEST_NO_FUSE" != 1 && test_set_prereq FUSE
|
||||
test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
|
||||
test "$TEST_NO_DOCKER" != 1 && type docker && test_set_prereq DOCKER
|
||||
|
||||
TEST_OS=$(uname -s | tr [a-z] [A-Z])
|
||||
test expr "$TEST_OS" : "CYGWIN_NT" >/dev/null && test_set_prereq POSIX
|
||||
|
||||
if test "$TEST_VERBOSE" = 1; then
|
||||
echo '# TEST_VERBOSE='"$TEST_VERBOSE"
|
||||
echo '# TEST_NO_FUSE='"$TEST_NO_FUSE"
|
||||
echo '# TEST_EXPENSIVE='"$TEST_EXPENSIVE"
|
||||
echo '# TEST_OS='"$TEST_OS"
|
||||
fi
|
||||
|
||||
# source our generic test lib
|
||||
|
@ -19,7 +19,7 @@ test_expect_success "ipfs init fails" '
|
||||
test_must_fail ipfs init 2> init_fail_out
|
||||
'
|
||||
|
||||
test_expect_success "ipfs init output looks good" '
|
||||
test_expect_success POSIX "ipfs init output looks good" '
|
||||
echo "Error: failed to take lock at $IPFS_PATH: permission denied" > init_fail_exp &&
|
||||
test_cmp init_fail_exp init_fail_out
|
||||
'
|
||||
@ -39,14 +39,16 @@ test_expect_success "ipfs cat fails" '
|
||||
test_expect_success "ipfs cat no repo message looks good" '
|
||||
echo "Error: no ipfs repo found in $IPFS_PATH." > cat_fail_exp &&
|
||||
echo "please run: ipfs init" >> cat_fail_exp &&
|
||||
test_cmp cat_fail_exp cat_fail_out
|
||||
test_path_cmp cat_fail_exp cat_fail_out
|
||||
'
|
||||
|
||||
# test that init succeeds
|
||||
test_expect_success "ipfs init succeeds" '
|
||||
export IPFS_PATH="$(pwd)/.ipfs" &&
|
||||
echo "IPFS_PATH: \"$IPFS_PATH\"" &&
|
||||
BITS="2048" &&
|
||||
ipfs init --bits="$BITS" >actual_init
|
||||
ipfs init --bits="$BITS" >actual_init ||
|
||||
test_fsh cat actual_init
|
||||
'
|
||||
|
||||
test_expect_success ".ipfs/ has been created" '
|
||||
|
Reference in New Issue
Block a user