1
0
Fork 0
forgejo/cmd
emilylange 230a677c74
test(dump): don't depend on directory listing order
cmd/dump.go uses os.Readdir to list the directory.

This is fine on its own, but TestAddRecursiveExclude in cmd/dump_test.go
depends on the order of the directory listing, which is where the issue
lays.

Directory listings using os.Readdir (lstat) don't actually guarantee an
order. They can differ due to a number of factors. Most notably the OS,
file system and settings.

As such, the test should not check the /order of the files/ added to the
archive, but instead simply check whether the archive /contains/ them.

So this is precisely what this commit does.

Note that only TestAddRecursiveExclude/File_inside_directory/No_exclude
has been observed to fail due to this, but all TestAddRecursiveExclude
subtests have been updated for consistency.
2024-06-17 17:54:59 +02:00
..
forgejo fix(f3): do not run the F3 CLI if F3 is disabled 2024-06-16 13:33:33 +02:00
actions.go
admin.go
admin_auth.go
admin_auth_ldap.go
admin_auth_ldap_test.go
admin_auth_oauth.go
admin_auth_stmp.go
admin_regenerate.go
admin_user.go
admin_user_change_password.go
admin_user_create.go
admin_user_delete.go
admin_user_generate_access_token.go
admin_user_list.go
admin_user_must_change_password.go
cert.go
cmd.go
docs.go
doctor.go
doctor_convert.go
doctor_test.go
dump.go
dump_repo.go
dump_test.go test(dump): don't depend on directory listing order 2024-06-17 17:54:59 +02:00
embedded.go
generate.go
hook.go
hook_test.go
keys.go
mailer.go
main.go feat(F3): CLI: f3 mirror to convert to/from Forgejo 2024-06-14 12:52:12 +02:00
main_test.go
manager.go
manager_logging.go
migrate.go
migrate_storage.go tests(cmd): add coverage for migrateActionsArtifacts 2024-06-09 16:02:31 +02:00
migrate_storage_test.go tests(cmd): add coverage for migrateActionsArtifacts 2024-06-09 16:02:31 +02:00
restore_repo.go
serv.go
web.go
web_acme.go
web_graceful.go
web_https.go