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

[FEATURE] Add integration tests to Redis #543

Open
guibranco opened this issue Sep 10, 2024 · 2 comments
Open

[FEATURE] Add integration tests to Redis #543

guibranco opened this issue Sep 10, 2024 · 2 comments
Labels
cache ⚙️ CI/CD Continuous Integration/Continuous Deployment processes communications 🎲 database Database-related operations 📝 documentation Tasks related to writing or updating documentation enhancement New feature or request gitauto GitAuto label to trigger the app in a issue. good first issue Good for newcomers hacktoberfest Participation in the Hacktoberfest event help wanted Extra attention is needed .NET Pull requests that update .net code Redis tests Tests

Comments

@guibranco
Copy link
Owner

guibranco commented Sep 10, 2024

Description

We need to add integration tests for Redis to ensure that our application interacts correctly with a real Redis instance. This will involve creating a new integration test project and setting up a Redis instance using Docker Compose and AppVeyor.

Steps to Implement

  1. Create Integration Tests Project:

    • Add a new test project named CrispyWaffle.IntegrationTests to the solution. It already exists
    • In this project, create a directory named Cache/Redis and add a test class RedisCacheRepositoryTests to test Redis interactions.
  2. Configure Redis for Testing:

    • Use Docker Compose to set up a Redis instance for local development and integration tests. This ensures that Redis can be easily spun up and managed as part of the testing process. The docker-compose.yml already has a Redis instance.
  3. Update AppVeyor Configuration:

    • Add steps to the AppVeyor configuration file (appveyor.yml) to set up a Redis instance for CI builds.

Tech Notes

  1. Setting Up Redis with Docker Compose:

    • Create a docker-compose.yml file in the root of your project with the following content to spin up a Redis instance:
      version: '3.1'
      
      services:
        redis:
          image: redis:5.0
          container_name: redis
          ports:
            - "6379:6379"
    • This configuration uses Redis version 5.0 and maps port 6379 for communication.
  2. Configure AppVeyor:

    • Update the appveyor.yml file to include Redis setup. You can use the following configurations:

      image: Visual Studio 2019
      
      before_build:
        - ps: |
            # Download and install Redis 5.0.14
            (new-object net.webclient).DownloadFile('https://github.com/tporadowski/redis/releases/download/v5.0.14.1/Redis-x64-5.0.14.1.msi', 'Redis-x64-5.0.14.1.msi')
            msiexec /i Redis-x64-5.0.14.1.msi /quiet /norestart
            # Start Redis server
            Start-Process "C:\Program Files\Redis\redis-server.exe" -ArgumentList "C:\Program Files\Redis\redis.windows.conf" -NoNewWindow -PassThru
    • This configuration installs Redis 5.0.14 and starts the Redis server on the AppVeyor build machine.

  3. Implement Tests:

    • In CrispyWaffle.IntegrationTests, implement tests in RedisCacheRepositoryTests to interact with the Redis instance.
    • Ensure that tests check various scenarios, such as setting, getting, and deleting cache entries.

Additional Notes

  • Verify that Redis is running correctly in both local development and CI environments before writing extensive tests.
  • Ensure that the docker-compose.yml file and appveyor.yml configurations are well-documented and maintained.

Screenshots or Diagrams

No response

Additional information

start redis-server on appveyor

@guibranco guibranco added the enhancement New feature or request label Sep 10, 2024
Copy link
Contributor

gitauto-ai bot commented Sep 10, 2024

Hello @guibranco, you have reached your request limit of 5, your cycle will refresh on 2024-09-21 10:07:38+00:00.
Consider subscribing if you want more requests.
If you have any questions or concerns, please contact us at info@gitauto.ai.

@guibranco guibranco added 📝 documentation Tasks related to writing or updating documentation help wanted Extra attention is needed good first issue Good for newcomers tests Tests cache 🎲 database Database-related operations .NET Pull requests that update .net code communications ⚙️ CI/CD Continuous Integration/Continuous Deployment processes hacktoberfest Participation in the Hacktoberfest event Redis labels Sep 10, 2024
@gitauto-ai gitauto-ai bot added the gitauto GitAuto label to trigger the app in a issue. label Oct 25, 2024
Copy link
Contributor

gitauto-ai bot commented Oct 25, 2024

Hey, I'm a bit lost here! Not sure which file I should be fixing. Could you give me a bit more to go on? Maybe add some details to the issue or drop a comment with some extra hints? Thanks!

Have feedback or need help?
Feel free to email info@gitauto.ai.

@gstraccini gstraccini bot added the 🛠 WIP Work in progress label Oct 25, 2024
@gstraccini gstraccini bot removed the 🛠 WIP Work in progress label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache ⚙️ CI/CD Continuous Integration/Continuous Deployment processes communications 🎲 database Database-related operations 📝 documentation Tasks related to writing or updating documentation enhancement New feature or request gitauto GitAuto label to trigger the app in a issue. good first issue Good for newcomers hacktoberfest Participation in the Hacktoberfest event help wanted Extra attention is needed .NET Pull requests that update .net code Redis tests Tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant