forgejo/cmd
joneshf 48035bbd4e chore: add tests for admin auth subcommands (#8433)
This PR is adds almost all tests in `cmd/admin_auth_oauth_test.go` with a bit of refactoring beforehand to make the tests easier to write. These should be legitimate refactors where the implementation changes but the public API/behavior does not change. All of the changes in this PR are done to align with how tests are written in `cmd/admin_auth_ldap_test.go`. Since `cmd/admin_auth_ldap.go` is a sibling file to `cmd/admin_auth_oauth.go`, it seems like their test files should also be aligned.

There are some tests added that show the current behavior as not ideal. E.g. not being able to update certain fields, or being able to set fields that are ultimately ignored. These are added so that the behavior is at least shown a bit more visibly. There should likely be a follow-up to fix some of these issues. But that will almost certainly be a breaking change that I'd rather avoid in this PR.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8433
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: joneshf <jones3.hardy@gmail.com>
Co-committed-by: joneshf <jones3.hardy@gmail.com>
2025-07-09 20:55:10 +02:00
..
forgejo chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
actions.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_auth.go chore: add tests for admin auth subcommands (#8433) 2025-07-09 20:55:10 +02:00
admin_auth_ldap.go chore: add tests for admin auth subcommands (#8433) 2025-07-09 20:55:10 +02:00
admin_auth_ldap_test.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_auth_oauth.go chore: add tests for admin auth subcommands (#8433) 2025-07-09 20:55:10 +02:00
admin_auth_oauth_test.go chore: add tests for admin auth subcommands (#8433) 2025-07-09 20:55:10 +02:00
admin_auth_stmp.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_regenerate.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user.go feat: add admin user reset-mfa CLI command (#8047) 2025-06-05 10:40:21 +02:00
admin_user_change_password.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user_create.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user_delete.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user_generate_access_token.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user_list.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user_must_change_password.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
admin_user_reset_mfa.go feat: add admin user reset-mfa CLI command (#8047) 2025-06-05 10:40:21 +02:00
cert.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
cmd.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
doctor.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
doctor_convert.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
doctor_test.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
dump.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
dump_repo.go [gitea] week 2025-19 cherry pick (gitea/main -> forgejo) (#7909) 2025-06-27 13:59:07 +02:00
dump_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
embedded.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
generate.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
hook.go feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
hook_test.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
keys.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
mailer.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
main.go fix: CLI is forgejo not Forgejo (#8049) 2025-06-03 09:25:58 +02:00
main_test.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
manager.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
manager_logging.go feat: add a EXCLUSION to the logger (#8212) 2025-07-04 00:08:23 +02:00
migrate.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
migrate_storage.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
migrate_storage_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
restore_repo.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
serv.go feat: bump the minimum required Git version from 2.0.0 to 2.34.1 (#8328) 2025-06-29 00:44:18 +02:00
web.go chore(upgrade): urfave/cli from v2 to v3 (#8035) 2025-06-01 22:16:37 +02:00
web_acme.go fix acme renewal (#7409) 2025-04-06 15:26:47 +00:00
web_graceful.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
web_https.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00