brainboxdotcc / DPP

C++ Discord API Bot Library - D++ is Lightweight and scalable for small and huge bots!
https://dpp.dev/
Apache License 2.0
1.05k stars 159 forks source link

Issue #936: Refactor Unit Test #1080

Closed mayankag32 closed 6 months ago

mayankag32 commented 7 months ago

Results from unittest.exe - Execution finished in 32.298 seconds. Failed: 0 Passed: 56 Skipped: 105 Percentage: 100.00%

[ Please outline your change here. Be sure to check the checkboxes below. ]

Code change checklist

netlify[bot] commented 7 months ago

Deploy Preview for dpp-dev ready!

Name Link
Latest commit bc2318a53aa87b7137621c8b86fef07bf30fe5c5
Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/65c908212430830008701753
Deploy Preview https://deploy-preview-1080--dpp-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

CLAassistant commented 7 months ago

CLA assistant check
All committers have signed the CLA.

braindigitalis commented 7 months ago

105 tests were skipped, does this still work with online tests?

mayankag32 commented 7 months ago

unit test with token -

UNIT TEST SUMMARY
==================
dpp::snowflake class                                         PASS
dpp::json_interface class                                    PASS
Instantiate DPP cluster                                      FAIL
cluster::start method                                        NOT EXECUTED
Connection to client websocket                               FAIL
Creation of application command                              NOT EXECUTED
Deletion of application command                              NOT EXECUTED
Log events                                                   NOT EXECUTED
Creation of a channel message                                NOT EXECUTED
Editing a channel message                                    NOT EXECUTED
Message edit event                                           NOT EXECUTED
Deletion of a channel message                                NOT EXECUTED
Receipt of a created message                                 NOT EXECUTED
Message attachment send and check                            NOT EXECUTED
Test guild cache                                             NOT EXECUTED
Test user cache                                              NOT EXECUTED
React to a message                                           NOT EXECUTED
Reaction event                                               NOT EXECUTED
Receive guild create event                                   FAIL
Get messages                                                 NOT EXECUTED
crossplatform_strptime()                                     NOT EXECUTED
utility::iconhash                                            PASS
cluster::current_user_get()                                  NOT EXECUTED
cluster::guild_get()                                         NOT EXECUTED
cluster::channel_get()                                       NOT EXECUTED
cluster::channels_get()                                      NOT EXECUTED
cluster::roles_get()                                         NOT EXECUTED
cluster::guild_get_invites()                                 NOT EXECUTED
cluster::guild_get_bans()                                    NOT EXECUTED
cluster::channel_pins_get()                                  NOT EXECUTED
cluster::guild_events_get()                                  NOT EXECUTED
cluster::guild_event_get()                                   NOT EXECUTED
message_create_t::send()                                     NOT EXECUTED
cluster::guild_event_users_get()                             NOT EXECUTED
start timer                                                  NOT EXECUTED
stop timer                                                   NOT EXECUTED
one-shot timer                                               NOT EXECUTED
timed listener                                               NOT EXECUTED
Presence intent                                              FAIL
Instantiate a cache                                          PASS
message_collector                                            FAIL
managed::get_creation_date()                                 PASS
utility::read_file()                                         PASS
ts_to_string()                                               PASS
ts_not_null()                                                PASS
command_option_choice::fill_from_json: double                PASS
command_option_choice::fill_from_json: int64_t               PASS
command_option_choice::fill_from_json: bool                  PASS
command_option_choice::fill_from_json: snowflake             PASS
command_option_choice::fill_from_json: string                PASS
https_client::get_host_info()                                PASS
https_client HTTPS request                                   FAIL
https_client HTTP request                                    PASS
run_once<T>                                                  PASS
webhook construct from URL                                   PASS
Markdown escaping (ignore code block contents)               PASS
Markdown escaping (escape code block contents)               PASS
URL encoding                                                 PASS
Base 64 encoding                                             PASS
sync<T>()                                                    FAIL
manged object comparison                                     PASS
find_channel()                                               NOT EXECUTED
channel type flags                                           NOT EXECUTED
create a forum channel                                       NOT EXECUTED
retrieve the created forum channel                           NOT EXECUTED
delete the created forum channel                             NOT EXECUTED
Human readable error translation                             PASS
cluster::guild_ban_add ban three deleted discord accounts    NOT EXECUTED
cluster::guild_get_ban getting one of the banned accounts    NOT EXECUTED
cluster::guild_get_bans get bans using the after-parameter   NOT EXECUTED
cluster::guild_ban_delete unban the banned discord accounts  NOT EXECUTED
cluster::thread_create                                       NOT EXECUTED
cluster::on_thread_create event                              NOT EXECUTED
cluster::channel_delete with thread                          NOT EXECUTED
cluster::on_thread_delete event                              NOT EXECUTED
cluster::thread_edit                                         NOT EXECUTED
cluster::on_thread_update event                              NOT EXECUTED
cluster::threads_get_active                                  NOT EXECUTED
creating a voice channel                                     NOT EXECUTED
editing the created voice channel                            NOT EXECUTED
deleting the created voice channel                           NOT EXECUTED
permission                                                   PASS
event class                                                  PASS
cluster::user_get                                            NOT EXECUTED
cluster::user_get flag parsing                               NOT EXECUTED
cluster::guild_get_member                                    NOT EXECUTED
user::get_mention                                            PASS
user::get_url                                                PASS
user::format_username                                        PASS
user::get_creation_time                                      PASS
user::get_avatar_url                                         PASS
channel::set_type                                            PASS
channel::get_mention                                         PASS
channel::get_url                                             PASS
message::get_url                                             PASS
utility::guild_navigation                                    PASS
utility::iconhash                                            PASS
utility::make_url_parameters                                 PASS
utility::markdown_escape                                     PASS
utility::tokenize                                            PASS
utility::url_encode                                          PASS
utility::slashcommand_mention                                PASS
utility::channel_mention                                     PASS
utility::user_mention                                        PASS
utility::role_mention                                        PASS
utility::emoji_mention                                       PASS
utility::user_url                                            PASS
utility::message_url                                         PASS
utility::channel_url                                         PASS
utility::thread_url                                          PASS
utility::avatar_size                                         PASS
utility::cdn_endpoint_url_hash                               PASS
sticker::get_url aka utility::cdn_endpoint_url_sticker       PASS
emoji::get_url                                               PASS
role::operator<                                              PASS
cluster::role_create                                         NOT EXECUTED
cluster::role_edit                                           NOT EXECUTED
cluster::role_delete                                         NOT EXECUTED
JSON parse error for post_rest                               PASS
cluster::user_get_cached_sync() with present member          FAIL
cluster::user_get_cached_sync() with not present member      PASS
interaction_create_t::get_parameter() with subcommands       PASS
interaction_create_t::get_parameter() without subcommands    PASS
cluster::automod_rule_create                                 NOT EXECUTED
cluster::automod_rule_get                                    NOT EXECUTED
cluster::automod_rules_get                                   NOT EXECUTED
cluster::automod_rule_delete                                 NOT EXECUTED
using the cluster::request method to fetch an image          NOT EXECUTED
cluster::guild_emoji_create                                  NOT EXECUTED
cluster::guild_emoji_get                                     NOT EXECUTED
cluster::guild_emoji_delete                                  NOT EXECUTED
cluster::on_invite_create                                    NOT EXECUTED
cluster::on_invite_delete                                    NOT EXECUTED
cluster::channel_invite_create                               NOT EXECUTED
cluster::invite_get                                          NOT EXECUTED
cluster::invite_delete                                       NOT EXECUTED
multiheader cookie test                                      SKIPPED
Connect to voice channel                                     SKIPPED
Send audio to voice channel                                  SKIPPED
Pinning a channel message                                    SKIPPED
Unpinning a channel message                                  SKIPPED
cluster::thread_member_add                                   SKIPPED
cluster::thread_member_get                                   SKIPPED
cluster::thread_members_get                                  SKIPPED
cluster::thread_member_remove                                SKIPPED
cluster::on_thread_members_update event with member addition SKIPPED
cluster::on_thread_members_update event with member removal  SKIPPED
cluster::thread_create_with_message                          SKIPPED
message manipulation in thread                               SKIPPED
cluster::on_message_create in thread                         SKIPPED
cluster::on_message_edit in thread                           SKIPPED
cluster::on_message_delete in thread                         SKIPPED
cluster::on_reaction_add in thread                           SKIPPED
cluster::on_reaction_remove in thread                        SKIPPED
coro: offline job                                            SKIPPED
coro: offline coroutine                                      SKIPPED
coro: offline task                                           SKIPPED
coro: offline async                                          SKIPPED
coro: online event handler                                   SKIPPED
coro: online api calls                                       SKIPPED
coro: online mumbo jumbo in event handler                    SKIPPED

Execution finished in 3.441 seconds.
Failed: 78 Passed: 58 Skipped: 25 Percentage: 42.65%
Mishura4 commented 7 months ago

Thanks for contributing!

Make sure you run the full suite of tests including online tests. You'll need to set a couple environment variables, see https://dpp.dev/unit-tests.html

Also pass "full" as the first command argument for some extra tests

mayankag32 commented 7 months ago

Thanks for contributing!

Make sure you run the full suite of tests including online tests. You'll need to set a couple environment variables, see https://dpp.dev/unit-tests.html

Also pass "full" as the first command argument for some extra tests

Thanks for the suggestion, I was looking for environment variables details.

braindigitalis commented 7 months ago

fails on mac os:

https://github.com/brainboxdotcc/DPP/actions/runs/7863356947/job/21453913274?pr=1080

Jaskowicz1 commented 7 months ago

Hi there, are you currently working on readding mac support and fixing the other issues? You seemed to fix the space indentation but left everything else.

Jaskowicz1 commented 6 months ago

We've closed this PR due to no activity. The PR also seems to be a direct copy of an old PR that was raised, with some additions. This also breaks our OSX support.