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

Use redis in tests instead of fakeredis #32

Merged
merged 6 commits into from
May 8, 2023

Conversation

iurev
Copy link
Contributor

@iurev iurev commented May 2, 2023

TODO:

  • Check Redis server v < 5.0
  • make the code more explanatory

Copy link
Member

@Envek Envek left a comment

Choose a reason for hiding this comment

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

Thank you!

See for some review nitpicks below ↓

# frozen_string_literal: true

def configure_test_redis_db
url = ENV.fetch("REDIS_URL", "redis://localhost:6379/6") # AnyCable uses Redis DB number 5 by default
Copy link
Member

Choose a reason for hiding this comment

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

redis://localhost:6379/*6* and AnyCable uses Redis DB number 5 by default? 🤔

Suggested change
url = ENV.fetch("REDIS_URL", "redis://localhost:6379/6") # AnyCable uses Redis DB number 5 by default
url = ENV.fetch("REDIS_URL", "redis://localhost:6379/5") # AnyCable uses Redis DB number 5 by default

README.md Outdated
Comment on lines 164 to 169
4. Pass redis-server URL to AnyCable using ENV variables

```bash
REDIS_URL=redis://localhost:6379/5 bundle exec rspec
```

Copy link
Member

Choose a reason for hiding this comment

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

Maybe move test-specific things to a different section, not to mix with general use configuration?

@Envek Envek marked this pull request as ready for review May 8, 2023 07:04
@Envek Envek merged commit 5e3c850 into anycable:master May 8, 2023
@Envek
Copy link
Member

Envek commented May 8, 2023

Thanks a lot!

Envek added a commit to smasry/graphql-anycable that referenced this pull request May 8, 2023
* origin/master:
  Use real Redis in tests instead of fakeredis gem (anycable#32)
Envek pushed a commit that referenced this pull request Aug 3, 2023
Envek added a commit that referenced this pull request May 7, 2024
…dling

* master:
  Switch to RubyGems Trusted publishing in CI release workflow [ci skip]
  add emergency actions TO README
  fix: consider redis_prefix in GraphQL::AnyCable::Cleaner
  add ability to set scan_count and added a little refactoring
  ability to fetch subscription stats
  use "around" instead "before"
  little refactoring
  add changes to README
  remove override redis_prefix and add an extra spec
  feat: Add configurable graphql redis_prefix
  Support empty operation name with redis.rb v5 (#34)
  Use arrays to fix deprecation warnings with redis gem 4.8 (#29)
  Use real Redis in tests instead of fakeredis gem (#32)
  Better `config.use_client_provided_uniq_id` deprecation (#27)
  Delay the deprecation warning of use_client_provided_uniq_id (#26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants