- This is a counterpart to pull request #607. Revised
test_deployed_state() to perform the same error-handling on Git
commands that cmdeploy does. If 'git rev-parse' returns an error,
the value "unknown" is used. If 'git diff' returns an error, the
null string is used.
- This fixes failures in environments where Git is not installed or
where the .git subdirectory is not present (as long as the server
was deployed in the same way).
- test_rewrite_subject() is prone to failure when it checks for the
delivered message, because fetch_all_messages() raises "ValueError:
no messages in imap folder". The check has the potential to happen
before the server has had a chance to deliver the message to the
user's inbox.
- Added a function try_n_times() that attempts to call a function the
specified number of times, with a 1-second sleep between calls. The
call is retried until it doesn't raise an exception. The last call
is made without a 'try' block, so that the final exception passes
through to the caller if it does not return.
- Wrapped call to fetch_all_messages() in try_n_times(), with 5
attempts specified. This should usually allow enough time for the
message to get moved from the postfix queue to the user's inbox.
- test_timezone_env() is producing the warning,
"PytestReturnNotNoneWarning: Test functions should return None, but
src/cmdeploy/tests/online/test_1_basic.py::test_timezone_env
returned <class 'bool'>".
- Revised test_timezone_env() to return None for success instead of
True.
- On a fresh install, if cmdeploy is run the first time with the
--disable-mail option, the echobot invite-link.txt file will not
exist yet.
- Only print the echobot invite link if --disable-mail was not
specified. This fixes the fresh-install error case, and also makes
sense when disabling mail in general, because the echo bot will not
be available at that time.
- Added 'try' blocks around the 'git rev-parse' and 'git diff'
commands that are run in deploy_chatmail(). If there is an error
running rev-parse, git_hash is set to "unknown". If there is an
error running diff, git_diff is set to the null string.
- This allows the deployment process work in two scenarios that would
otherwise fail with an exception:
- Systems where the 'git' command is not available.
- When running with a copy of the tree content of chatmail/relay,
but without a copy of the .git directory.