Commit Graph

46 Commits

Author SHA1 Message Date
Jojo-1000 917e2cd0c4 Remove obsolete custom platform detection. 2024-05-30 02:14:05 +02:00
Kenneth Skovhede 473c6cbbb8 Merge commit '4f577c65a4d8806f79637c50c21ca3a683c5a07a' into feature/kestrel-avalonia-upgrade 2024-03-04 12:21:53 +01:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Thomas Suckow cfa41434ad Add process memory usage and print more often 2022-05-13 07:54:24 -07:00
Thomas Suckow 3172ec3a4b More logging in tests 2022-05-06 21:46:17 -07:00
Thomas Suckow 5956b771f0 Cleanup inconsistent overrides of test SetUp and TearDown.
Also add some memory usage diagnostics
2022-05-05 22:30:15 -07:00
Thomas Suckow e66fc1ddc8 Test name logging. 2022-05-01 22:55:03 -07:00
Thomas Suckow 06bca4b5d8 Try making test path absolute 2022-04-10 20:52:01 -07:00
Thomas Suckow 71faeb9a0e Try gzipping the logs 2022-03-14 21:07:07 -07:00
Thomas Suckow 20214f6c00 Don't delete logs after test 2022-03-13 10:22:32 -07:00
Thomas Suckow dfd210125e Move logs to folder 2022-03-13 10:02:13 -07:00
Thomas Suckow 081502fc2a Logs
Stop writing test data to home folder by default
Store logs in github for inspection
Be a little less verbose
2022-03-12 21:30:16 -08:00
Dean Ferreyra f4195e4eb0 Address review comments from @warwickmm
Replace `VerifyDir` and `CompareFiles` with
`AssertDirectoryTreesAreEquivalent` and `AssertFilesAreEqual`.

Move `WriteFile` to `TestUtils`.

Add "Symlink" category to start.sh.
2020-09-11 20:06:53 -07:00
Dean Ferreyra be6ac941ea Add symlink policy tests
This adds a basic symlink policy test that performs backups using each
symlink policy.

If you don't have the required privilege in Windows, you can get an
exception trying to create a symbolic link.  If an exception is thrown
trying to create a symbolic link, the exception is trapped and the
test is marked as "Ignored"; e.g.,
```
1) Ignored : Duplicati.UnitTest.SymLinkTests.SymLinkPolicy
Client could not create a symbolic link.  Error reported: (1314) A required privilege is not held by the client. | Read: [C:\td\backup-data\target] | Write: [C:\td\backup-data\symlink]
```
2020-09-07 22:50:21 -07:00
Dean Ferreyra 2e777b2711 Change tests to work with long paths in Windows
Change SystemIOWindows.PathGetFullPath() to convert forward
slashes to backslashes.

Change Duplicati.UnitTest.BasicSetupHelper.ZipFileExtractToDirectory()
to rely on slash fix-ups.
2020-07-30 05:08:18 -07:00
Dean Ferreyra 73e31a79a1 Change tests to work with long paths in Windows
Even in .NET 4.6.2
`System.IO.Compression.ZipFile.ExtractToDirectory()` cannot handle
long paths.  Replace call to
`System.IO.Compression.ZipFile.ExtractToDirectory()` with an
equivalent that extracts files to a temporary location and uses I/O
functions that support long paths to move them to their final
location.

In CommandLineOperationsTests.cs, use ISystemIO functions to handle
potentially long paths.

Add a fix to RecoveryTool for long paths that was missed by #4258.

This fixes #3863.
2020-07-28 05:51:53 -07:00
Kenneth Hsu 83ac03843d Fix spelling errors in comments.
In doing so, we also normalized some line endings.
2019-12-14 09:52:55 -08:00
Kenneth Hsu afecf891da Add test for keep-time retention logic.
We had to remove the keep-versions options since multiple retention
options are not allowed.

This concerns issue #3982.
2019-11-28 21:50:16 -08:00
Kenneth Hsu 507beea277 Add tests for stopping after current file. 2019-09-17 12:46:23 -07:00
BlueBlock db6456a628 cleanup the sqlite journal file if it exists
can happen after an exception
2019-08-25 10:55:36 -04:00
Kenneth Hsu 0bb3cf0c5e Run OneTimeTearDown in OneTimeSetUp to ensure clean initialization. 2019-08-18 18:00:23 -07:00
Kenneth Hsu caaedccc61 Remove recreated database file after each test. 2019-08-18 17:46:13 -07:00
Kenneth Hsu d29c9e090d Delete restore folder after each test. 2019-08-18 16:01:54 -07:00
Kenneth Hsu e2fda04a4c Delete test zip files and folders after tests complete. 2019-08-18 15:31:15 -07:00
Kenneth Hsu bcb1427b51 Avoid removing test base folder.
The base folder might contain additional content that the user does not
expect to be deleted.  We should only remove files/folders that we
create in the tests.
2019-08-18 14:27:01 -07:00
Kenneth Hsu 3a1c646855 Use braces for if statements. 2019-08-18 14:27:01 -07:00
Kenneth Hsu 90302de23c Delete base folder contents in test setup.
This also prevents undesired side effects if we later add additional
behaviors to the teardown method.
2019-08-18 14:27:01 -07:00
Kenneth Hsu baf3b6d52a Rename methods to clarify behaviors. 2019-08-18 14:27:01 -07:00
Kenneth Hsu d364be4037 Clean test data after each test. 2019-08-18 14:27:01 -07:00
Kenneth Hsu ead6845e5d Remove base test folder instead of individual members. 2019-08-18 14:01:31 -07:00
Kenneth Hsu 3d82d95a63 Delete directories before specific files.
This is purely for aesthetic reasons.
2019-08-18 14:01:31 -07:00
Kenneth Hsu a6f751f605 Move creation of test data folders to base class. 2019-08-18 14:01:27 -07:00
Kenneth Hsu 84bb7999a7 Remove unnecessary log output. 2019-08-17 19:54:55 -07:00
Kenneth Hsu 99cf1bff29 Add teardown to clean up test data. 2019-08-17 14:40:54 -07:00
Kenneth Skovhede 68c36edbf7 Added a new unittest option that disables auto-fixes to make sure we do not mask errors by auto-fixing them during unittests 2018-06-12 09:31:39 +02:00
Kenneth Skovhede 1322455786 Improved output when running unittest 2018-06-12 08:52:57 +02:00
verhoek d9fc1cac08 Moved travis script steps to separate bash script with trap on error, to prevent continuing executing further steps on error. 2018-05-18 07:57:55 +02:00
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01:00
Kenneth Hsu 839c8d9f27 Use method to parse string into bool to reduce duplication. 2017-12-17 14:52:29 -08:00
Kenneth Hsu c9aa6cf5fb Avoid performing tilde expansion.
The expansion being performed was often incorrect, as it's possible for
the tilde character to appear as part of the path where it should not be
expanded to the user's home directory.

Properly supporting tilde expansion is complicated and requires
additional study.  Instead of supporting it only partially, we have
decided to simplify things and just drop tilde expansion for now.  See
the discussion in issue #2619, as well as issues #2325 and #2555.
2017-10-21 10:08:33 -07:00
Tyler Gill 83a1dcfb64 Replace all instances of InvariantCultureIgnoreCase with OrdinalIgnoreCase in string comparisons.
InvariantCulture is useful when comparing / sorting human language strings in a culturely correct way. It handles things like accented letters in a way that makes sense to humans (e.g., 'a' should be sorted next to 'á', rather than after 'z').
Ordinal looks just at the raw code points of the characters. As such, it is recommended for use in cases when comparing system strings (file paths, command line parameters, config settings, etc.). Since it doesn't need to use the culture specific sorting rules, this method can often be faster.

For more information, see https://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison (and other related questions)
2017-09-18 23:55:08 -06:00
Kenneth Skovhede f3fa60e49f Upgrade NUnit to use 3.4.1 (#1959)
Updated NUnit to version 3.4.1 and added some extra display helps to Travis
2016-09-29 13:45:55 +02:00
Kenneth Skovhede e2e645a6a0 Added option to set the base folder for unittests from an environment variable 2016-04-06 20:42:12 +02:00
Kenneth Skovhede 60bd9693d0 Imporved handling of the ~ character in paths 2015-09-05 09:14:21 +02:00
Kenneth Skovhede 6dac0f3c2e Fixed an invalid line-ending character 2015-08-05 13:51:56 +02:00
Kenneth Skovhede e6a8cdd6be Refactored the commandline unittest for easier reuse 2015-07-10 10:23:54 +02:00