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

Add Redis module #642

Merged
merged 15 commits into from
Jan 10, 2024
Merged

Add Redis module #642

merged 15 commits into from
Jan 10, 2024

Conversation

djakielski
Copy link
Contributor

@djakielski djakielski commented Aug 20, 2023

Adds new testcontainer for redis

Task:

  • docs
  • write & read tests
  • execute redis cli command
  • container start
  • password authentication
  • persistent volume

@netlify
Copy link

netlify bot commented Aug 20, 2023

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit f6307b6
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-node/deploys/658c1b8617dc8b0008bf21c4
😎 Deploy Preview https://deploy-preview-642--testcontainers-node.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.

@djakielski djakielski marked this pull request as draft August 20, 2023 21:19
@djakielski djakielski changed the title [darft] add new redis module add new redis module Aug 20, 2023
@djakielski djakielski marked this pull request as ready for review August 27, 2023 16:11
This was referenced Aug 27, 2023
@djakielski
Copy link
Contributor Author

Hi @cristianrgreco, it's ready for review.

@djakielski
Copy link
Contributor Author

Hi @cristianrgreco, who can I ask for a review? There's no contribution guide lines or a how to.

@cristianrgreco
Copy link
Collaborator

Hi @djakielski, I've been away the last couple of weeks. I'm back now and will have a look. Thanks for the contributions!

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality labels Sep 12, 2023

export class RedisContainer extends GenericContainer {
private password = "";
private persistenceVolume = "";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's use an optional type private persistenceVolume?: string and then check if (this.persistenceVolume) to get type-checking support. We could do the same with the password

Copy link
Collaborator

@cristianrgreco cristianrgreco left a comment

Choose a reason for hiding this comment

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

Only nitpicks - a great contribution, thank you!

I'll need to think of something else to use as the Quickstart example 😄

djakielski and others added 4 commits September 12, 2023 11:49
Co-authored-by: Cristian Greco <cristianrgreco@gmail.com>
Co-authored-by: Cristian Greco <cristianrgreco@gmail.com>
@djakielski
Copy link
Contributor Author

Hi @cristianrgreco, how can i start all these test again? I had fixed an issue and want to retest it.

@bijela-gora
Copy link

Nice contribution!

Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @djakielski ! I've left some comments.

...(this.persistenceVolume ? ["--save 1 1 ", "--appendonly yes"] : []),
])
.withStartupTimeout(120_000);
if (this.persistenceVolume) this.withBindMounts([{ mode: "rw", source: this.persistenceVolume, target: "/data" }]);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is something we would like to do. Testcontainers encourages to use copyFilesToContainer instead and make sure the tests are portable across docker environments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about persisting Tests. But on the view of making tests independent, you're right. I will fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@djakielski AFAIK this is the only change pending

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cristianrgreco I had some trouble with correct way of importing data via redis cli when executing command in the container. I solved it via bash script.

@Meir017 Meir017 mentioned this pull request Nov 1, 2023
@cristianrgreco cristianrgreco changed the title add new redis module Add Redis module Dec 9, 2023
@djakielski
Copy link
Contributor Author

@cristianrgreco do you have any idea why the tests are failing? What did i wrong?

@cristianrgreco
Copy link
Collaborator

@djakielski I've noticed some intermittent issues with the GHA runners over the last few days. I've kicked off the tests again, hopefully the issue is now resolved. Nothing related with this PR

@djakielski
Copy link
Contributor Author

@cristianrgreco could you rerun the tests? Seems like another temporary issue.

@cristianrgreco
Copy link
Collaborator

Thanks for your patience and effort @djakielski, much appreciated!

@cristianrgreco cristianrgreco merged commit f150058 into testcontainers:main Jan 10, 2024
88 checks passed
@djakielski djakielski deleted the redis branch January 10, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Backward compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants