mirror of
https://github.com/rclone/rclone.git
synced 2025-01-13 20:38:12 +02:00
5e91b93e59
There was no easy way to automatically test the end-to-end functionality of commands, flags, environment variables etc. The need for end-to-end testing was highlighted by the issues fixed in #5341. There was no automated test to continually verify current behaviour, nor a framework to quickly test the correctness of the fixes. This change adds an end-to-end testing framework in the cmdtest folder. It has some simple examples in func TestCmdTest in cmdtest_test.go. The tests should be readable by anybody familiar with rclone and look like this: // Test the rclone version command with debug logging (-vv) out, err = rclone("version", "-vv") if assert.NoError(t, err) { assert.Contains(t, out, "rclone v") assert.Contains(t, out, "os/version:") assert.Contains(t, out, " DEBUG : ") } The end-to-end tests are executed just like the Go unit tests, that is: go test ./cmdtest -v The change also contains a thorough test of environment variables in environment_test.go. Thanks to @ncw for encouragement and introduction to the TestMain trick. |
||
---|---|---|
.. | ||
commands | ||
_index.md | ||
alias.md | ||
amazonclouddrive.md | ||
authors.md | ||
azureblob.md | ||
b2.md | ||
box.md | ||
bugs.md | ||
cache.md | ||
changelog.md | ||
chunker.md | ||
compress.md | ||
contact.md | ||
crypt.md | ||
docs.md | ||
donate.md | ||
downloads.md | ||
drive.md | ||
dropbox.md | ||
faq.md | ||
fichier.md | ||
filefabric.md | ||
filtering.md | ||
flags.md | ||
ftp.md | ||
googlecloudstorage.md | ||
googlephotos.md | ||
gui.md | ||
hdfs.md | ||
http.md | ||
hubic.md | ||
install.md | ||
install.sh | ||
jottacloud.md | ||
koofr.md | ||
licence.md | ||
local.md | ||
mailru.md | ||
mega.md | ||
memory.md | ||
onedrive.md | ||
opendrive.md | ||
overview.md | ||
pcloud.md | ||
premiumizeme.md | ||
privacy.md | ||
putio.md | ||
qingstor.md | ||
rc.md | ||
remote_setup.md | ||
s3.md | ||
seafile.md | ||
sftp.md | ||
sharefile.md | ||
sugarsync.md | ||
swift.md | ||
tardigrade.md | ||
union.md | ||
uptobox.md | ||
webdav.md | ||
yandex.md | ||
zoho.md |