Skip to content

[Enhancement]: (Docs) Better Usage example for golang redis driver #3255

@muhammedkucukaslan

Description

@muhammedkucukaslan

Proposal

In the docs, usage is given:

redisContainer, err := tcredis.Run(ctx,
    "redis:7",
    tcredis.WithSnapshotting(10, 1),
    tcredis.WithLogLevel(tcredis.LogLevelVerbose),
    tcredis.WithConfigFile(filepath.Join("testdata", "redis7.conf")),

And when i copied and run that, i got this error as nature:

                Error Trace:    /home/muhammedkucukaslan/code/projects/advanced-todo-api/tests/utils.go:55
                                                        /home/muhammedkucukaslan/code/projects/advanced-todo-api/tests/e2e/todo/create_todo_handler_caching_test.go:61
                Error:          Received unexpected error:
                                generic container: create container: created hook: can't copy testdata/redis7.conf to container: open testdata/redis7.conf: no such file or directory
                Test:           TestCreateTodoHandlerCaching
                Messages:       failed to start Redis container
--- FAIL: TestCreateTodoHandlerCaching (3.24s)

Solution

I know that following docs are explaining that this is an optional config but it think it would be better to make it like bellow for faster quickstart:

redisContainer, err := tcredis.Run(context.Background(), "redis:7")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions