-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
.NETPull requests that update .net codePull requests that update .net codeRediscachecommunicationsenhancementNew feature or requestNew feature or requestgitautoGitAuto label to trigger the app in a issue.GitAuto label to trigger the app in a issue.good first issueGood for newcomersGood for newcomershacktoberfestParticipation in the Hacktoberfest eventParticipation in the Hacktoberfest eventhelp wantedExtra attention is neededExtra attention is neededtestsTestsTests⚙️ CI/CDContinuous Integration/Continuous Deployment processesContinuous Integration/Continuous Deployment processes🎲 databaseDatabase-related operationsDatabase-related operations📝 documentationTasks related to writing or updating documentationTasks related to writing or updating documentation
Description
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
-
Create Integration Tests Project:
- Add a new test project named
CrispyWaffle.IntegrationTeststo the solution. It already exists - In this project, create a directory named
Cache/Redisand add a test classRedisCacheRepositoryTeststo test Redis interactions.
- Add a new test project named
-
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.ymlalready has a Redis instance.
- 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
-
Update AppVeyor Configuration:
- Add steps to the AppVeyor configuration file (
appveyor.yml) to set up a Redis instance for CI builds.
- Add steps to the AppVeyor configuration file (
Tech Notes
-
Setting Up Redis with Docker Compose:
- Create a
docker-compose.ymlfile 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.
- Create a
-
Configure AppVeyor:
-
Update the
appveyor.ymlfile 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.
-
-
Implement Tests:
- In
CrispyWaffle.IntegrationTests, implement tests inRedisCacheRepositoryTeststo interact with the Redis instance. - Ensure that tests check various scenarios, such as setting, getting, and deleting cache entries.
- In
Additional Notes
- Verify that Redis is running correctly in both local development and CI environments before writing extensive tests.
- Ensure that the
docker-compose.ymlfile andappveyor.ymlconfigurations are well-documented and maintained.
Screenshots or Diagrams
No response
Additional information
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
.NETPull requests that update .net codePull requests that update .net codeRediscachecommunicationsenhancementNew feature or requestNew feature or requestgitautoGitAuto label to trigger the app in a issue.GitAuto label to trigger the app in a issue.good first issueGood for newcomersGood for newcomershacktoberfestParticipation in the Hacktoberfest eventParticipation in the Hacktoberfest eventhelp wantedExtra attention is neededExtra attention is neededtestsTestsTests⚙️ CI/CDContinuous Integration/Continuous Deployment processesContinuous Integration/Continuous Deployment processes🎲 databaseDatabase-related operationsDatabase-related operations📝 documentationTasks related to writing or updating documentationTasks related to writing or updating documentation