switchupcb / disgo

Create a Discord Bot in Go using this Discord API Wrapper. The next generation of Discord API Consumption.
Apache License 2.0
89 stars 2 forks source link

add coverage integration test base #33

Closed switchupcb closed 2 years ago

switchupcb commented 2 years ago

This is a restart of #19. The following tasks need to be completed:

Update: This pull request has added endpoints without dependencies and provided the basis of the coverage test. The full version of this feature will be continued in a future pull request.

switchupcb commented 2 years ago

Dependent on none.

  1. CreateGlobalApplicationCommand
  2. ListNitroStickerPacks
  3. CreateFollowupMessage*
  4. GetUserConnections
  5. CreateInteractionResponse*
  6. GetCurrentBotApplicationInformation
  7. GetUser
  8. GetCurrentUser
  9. GetCurrentAuthorizationInformation
  10. CreateGuild
  11. ListVoiceRegions

*Interaction Dependent.

Dependent on one.

  1. GetGlobalApplicationCommand
  2. EditApplicationCommandPermissions
  3. GetApplicationCommandPermissions
  4. DeleteGlobalApplicationCommand
  5. GetGlobalApplicationCommands
  6. EditGlobalApplicationCommand
  7. EditFollowupMessage
  8. DeleteFollowupMessage
  9. GetFollowupMessage
  10. EditOriginalInteractionResponse
  11. DeleteOriginalInteractionResponse
  12. GetOriginalInteractionResponse
  13. ModifyCurrentUser
  14. GetCurrentUserGuilds
  15. CreateGuildChannel
  16. CreateGuildScheduledEvent
  17. AddGuildMember
  18. ModifyCurrentUserVoiceState
  19. GetGuildWidget
  20. CreateAutoModerationRule
  21. GetGuildBans
  22. GetGuild
  23. GetGuildChannels
  24. ModifyGuildWidget
  25. ModifyGuildWelcomeScreen
  26. CreateGuildEmoji
  27. ListScheduledEventsforGuild
  28. GetGuildWidgetImage
  29. DeleteGuild
  30. GetGuildWelcomeScreen
  31. SearchGuildMembers
  32. CreateStageInstance
  33. CreateGuildRole
  34. BeginGuildPrune
  35. GetGuildRoles
  36. GetGuildIntegrations
  37. CreateGuildSticker
  38. GetCurrentUserGuildMember
  39. GetGuildWidgetSettings
  40. GetGuildAuditLog
  41. GetGuildTemplates
  42. LeaveGuild
  43. ListAutoModerationRulesForGuild
  44. GetGuildInvites
  45. GetGuildVanityURL
  46. ListActiveGuildThreads
  47. ModifyCurrentMember
  48. GetGuildPreview
  49. GetGuildVoiceRegions
  50. CreateGuildTemplate
  51. ModifyGuild
  52. ListGuildMembers
  53. GetGuildPruneCount
  54. GetGuildTemplate
  55. CreateGuildApplicationCommand

Dependent on two.

  1. GetChannel
  2. CreateChannelInvite
  3. CreateMessage
  4. ListGuildEmojis
  5. DeleteCloseChannel
  6. GetChannelInvites
  7. GetChannelMessages
  8. GetPinnedMessages
  9. EditChannelPermissions
  10. StartThreadfromMessage
  11. ModifyChannelGuild
  12. ListPublicArchivedThreads
  13. DeleteChannelPermission
  14. StartThreadwithoutMessage
  15. ListPrivateArchivedThreads
  16. StartThreadinForumChannel
  17. FollowAnnouncementChannel
  18. ModifyGuildChannelPositions
  19. ModifyChannel
  20. ListJoinedPrivateArchivedThreads
  21. ModifyGuildScheduledEvent
  22. GetGuildScheduledEventUsers
  23. GetGuildScheduledEvent
  24. DeleteGuildScheduledEvent
  25. GetGuildMember
  26. CreateGuildBan
  27. RemoveGuildMember
  28. ModifyUserVoiceState
  29. ModifyGuildMember
  30. ModifyAutoModerationRule
  31. DeleteAutoModerationRule
  32. GetAutoModerationRule
  33. ModifyGuildEmoji
  34. DeleteGuildEmoji
  35. GetGuildEmoji
  36. DeleteStageInstance
  37. ModifyStageInstance
  38. GetStageInstance
  39. AddGuildMemberRole
  40. ModifyGuildRolePositions
  41. DeleteGuildRole
  42. ModifyGuildRole
  43. GetGuildSticker
  44. ListGuildStickers
  45. DeleteGuildSticker
  46. ModifyGuildSticker
  47. GetSticker
  48. GetInvite
  49. SyncGuildTemplate
  50. ModifyGuildTemplate
  51. DeleteGuildTemplate
  52. CreateGuildfromGuildTemplate
  53. GetGuildApplicationCommands
  54. GetGuildApplicationCommand
  55. DeleteGuildApplicationCommand
  56. EditGuildApplicationCommand
  57. GetGuildApplicationCommandPermissions

Dependent on three+.

  1. CrosspostMessage
  2. DeleteAllReactions
  3. CreateReaction
  4. PinMessage
  5. GetReactions
  6. EditMessage
  7. GetChannelMessage
  8. DeleteMessage
  9. ListThreadMembers
  10. ModifyChannelThread
  11. AddThreadMember
  12. JoinThread
  13. RemoveGuildBan
  14. GetGuildBan
  15. RemoveGuildMemberRole
  16. DeleteInvite
  17. DeleteUserReaction
  18. DeleteAllReactionsforEmoji
  19. DeleteOwnReaction
  20. UnpinMessage
  21. GetThreadMember
  22. RemoveThreadMember
  23. LeaveThread
switchupcb commented 2 years ago

Rebase with working go.work configuration commit.

switchupcb commented 2 years ago

The endpoints that have been added to the unused map are generally understandable. A user state refers to the fact that the endpoint would only be test-able with the assistance of a user. However, using user-bots is a ban-able offence on Discord. As a result, these endpoints (interactions, etc) will not be added.

Using endpoints that require files would require the CICD pipeline to also involve those files. However, I do not want to include random image files in the repository. Even if a logo is added, it would not be the correct size required for those endpoints.

Using endpoints that involve creating state (i.e CreateGuild) have been removed to simplify the coverage test. Originally, the bot would create a guild. However, this would be hard to ensure that the action was realized without the addition of a complex state (such that a user can confirm the guild is created). Instead, the bot will start the coverage test with a Guild already provided, such that a user can monitor the test if required.

If OAUTH2 is not tested in the coverage test, then GetCurrentAuthorizationInformation should also be excluded.

switchupcb commented 2 years ago

On the other hand, it seems disgo is missing two endpoints: ModifyGuildMFALevel, and CreateDM. Either dasgo is missing these endpoints, or disgo didn't mark them in the generate.go file.

switchupcb commented 2 years ago

Following the above exclusions, the coverage test is as follows.

  1. GetCurrentUser
  2. GetCurrentAuthorizationInformation
  3. GetCurrentBotApplicationInformation
  4. CreateGlobalApplicationCommand
  5. ListVoiceRegions
  6. GetUser
  7. GetUserConnections

Dependent on one.

  1. GetGlobalApplicationCommand
  2. DeleteGlobalApplicationCommand
  3. EditApplicationCommandPermissions
  4. EditGlobalApplicationCommand
  5. GetApplicationCommandPermissions
  6. GetGlobalApplicationCommands
  7. GetCurrentUserGuilds
  8. GetGuildVanityURL
  9. BeginGuildPrune
  10. GetGuildInvites
  11. ListScheduledEventsforGuild
  12. GetGuild
  13. CreateGuildRole
  14. GetGuildTemplates
  15. GetGuildAuditLog
  16. GetGuildPreview
  17. GetGuildWidget
  18. CreateStageInstance
  19. SearchGuildMembers
  20. GetGuildWelcomeScreen
  21. ModifyGuildWelcomeScreen
  22. CreateGuildApplicationCommand
  23. GetGuildChannels
  24. AddGuildMember
  25. GetGuildVoiceRegions
  26. GetGuildWidgetSettings
  27. ModifyGuildWidget
  28. GetCurrentUserGuildMember
  29. CreateGuildChannel
  30. GetGuildTemplate
  31. ListActiveGuildThreads
  32. GetGuildBans
  33. CreateGuildScheduledEvent
  34. GetGuildPruneCount
  35. ModifyCurrentMember
  36. GetGuildWidgetImage
  37. ListAutoModerationRulesForGuild
  38. CreateAutoModerationRule
  39. GetGuildRoles
  40. ModifyCurrentUserVoiceState
  41. ListGuildMembers
  42. GetGuildIntegrations
  43. GetSticker
  44. GetInvite
  45. ModifyGuildRolePositions
  46. DeleteGuildRole
  47. ModifyGuildRole
  48. ModifyStageInstance
  49. DeleteStageInstance
  50. GetStageInstance
  51. GetGuildEmoji
  52. DeleteGuildApplicationCommand
  53. GetGuildApplicationCommandPermissions
  54. EditGuildApplicationCommand
  55. GetGuildApplicationCommands
  56. GetGuildApplicationCommand
  57. RemoveGuildMember
  58. GetGuildMember
  59. ModifyGuildMember
  60. ModifyUserVoiceState
  61. AddGuildMemberRole
  62. EditChannelPermissions
  63. ListPrivateArchivedThreads
  64. ListGuildEmojis
  65. CreateChannelInvite
  66. ModifyChannelGuild
  67. ListPublicArchivedThreads
  68. ModifyChannel
  69. CreateMessage
  70. GetChannelInvites
  71. ModifyGuildChannelPositions
  72. DeleteCloseChannel
  73. GetChannelMessages
  74. DeleteChannelPermission
  75. StartThreadfromMessage
  76. ListJoinedPrivateArchivedThreads
  77. GetChannel

Dependent on two.

  1. StartThreadinForumChannel
  2. StartThreadwithoutMessage
  3. GetPinnedMessages
  4. GetGuildScheduledEvent
  5. ModifyGuildScheduledEvent
  6. GetGuildScheduledEventUsers
  7. DeleteGuildScheduledEvent
  8. ModifyAutoModerationRule
  9. DeleteAutoModerationRule
  10. GetAutoModerationRule
  11. DeleteInvite
  12. GetGuildBan
  13. RemoveGuildMemberRole
  14. GetReactions

Dependent on three+.

  1. CrosspostMessage
  2. GetChannelMessage
  3. CreateReaction
  4. EditMessage
  5. DeleteAllReactions
  6. PinMessage
  7. DeleteMessage
  8. ModifyChannelThread
  9. ListThreadMembers
  10. AddThreadMember
  11. JoinThread
  12. DeleteUserReaction
  13. DeleteOwnReaction
  14. DeleteAllReactionsforEmoji
  15. UnpinMessage
  16. RemoveThreadMember
  17. GetThreadMember
  18. LeaveThread