Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Minitest with RSpec: bigbluebutton_api_controller specs (1) #911

Merged

Conversation

scouillard
Copy link
Contributor

@scouillard scouillard commented Apr 21, 2023

Description

  • Fix RSpec configs
  • Remove redis_helper
  • Add bbb_api_controller specs
  • Add Server Factory
  • Add Meeting Factory

Design considerations

  • Reverse the logic for checksum check: Before, we had to disable the checksum check in (almost) every test. But, considering most of the tests are not testing the checksum specifically, the checksum check is now disabled by default for all the specs and has to be enabled when testing the checksum specifically.
  • In #create, a voiceBridge attribute is provided in every #create request to bypass the voiceBridge generator. This is because the stubbed request will never match the outside request as a voiceBridge generated and added to the uri by Scalelite.
  • Removed the redis_helper file as we will be using fakeredis and we don't need to configure a redis database for the test environment

Notes

  • The order of the parameters in a URL query string should not affect the functioning of the API request. For example, in #create, override_create_params adds the new params at the end of the uri, and default_create_params adds them at the beginning of the uri. Not following the order will return a different checksum value.

spec/spec_helper.rb Outdated Show resolved Hide resolved
@scouillard scouillard force-pushed the translate-bbb-api-specs branch 2 times, most recently from 2802004 to c7f416c Compare April 24, 2023 21:11
@scouillard scouillard changed the title Replace Minitest with RSpec as testing framework Replace Minitest with RSpec: bigbluebutton_api_controller specs Apr 24, 2023
config/redis_store.yml Outdated Show resolved Hide resolved
@scouillard scouillard changed the title Replace Minitest with RSpec: bigbluebutton_api_controller specs Replace Minitest with RSpec: bigbluebutton_api_controller specs (1) May 1, 2023
@@ -65,6 +69,4 @@
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")
config.include FactoryBot::Syntax::Methods

config.include RSpec::RedisHelper, redis: true
Copy link
Contributor Author

@scouillard scouillard May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon reviewing, I support using fakeredis for our testing environment

fakeredis ensures that the tests are isolated from each other. Hence, redis_helper was removed as it seems it was used strictly to configure a redis database for the test environment.

However, there might be complex Redis usage implementation in the future that makes fakeredis not suitable.

Everything seems to be working as it should on our testing environment for now.

@farhatahmad farhatahmad merged commit d75c4cd into blindsidenetworks:develop May 4, 2023
1 check passed
@sonarcloud
Copy link

sonarcloud bot commented May 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants