Mock Web APIs with Testcontainers in Go

Поділитися
Вставка
  • Опубліковано 17 тра 2024
  • #golang #coding #testing #integration #api #tutorial
    In this video I show you can spin up custom docker images using Testcontainers automatically in your integration tests, and I show how you can easily spin up a custom web API inside the container to integration your code.
    This is a great way to make your integration tests do almost anything, you have the power of Docker at your fingertips and can mock most anything to test properly integrating with it.
    Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.
    testcontainers.com/
  • Наука та технологія

КОМЕНТАРІ • 10

  • @eldr-io
    @eldr-io  22 дні тому +2

    The repo for the code in this tutorial is here: github.com/sigrdrifa/testcontainers-go-api
    And the editor I use is Neovide (neovim), the config is here: github.com/sigrdrifa/nvim
    thanks for watching!

  • @Difcar
    @Difcar 15 днів тому

    A really clear and easy to follow explanation! Thanks :)

  • @NeuroDrizz
    @NeuroDrizz 22 дні тому +2

    Pretty cool, elegant implementation.

  • @raptorate2872
    @raptorate2872 23 дні тому +1

    Thank you for this approach, i wanted a way to automate container tests that i was doing manually or through shell scripts remotely. With test containers, i could fire them up against live containers (pods) via kubernetes.

  • @jswlprtk
    @jswlprtk 23 дні тому +3

    Your neovim config is amazing! Looks very similar to the Lite-XL text editor. Is there a place where I can find your neovim config(dotfiles)?

    • @eldr-io
      @eldr-io  22 дні тому

      Sure thing, see the pinned comment

  • @SayfSentinel
    @SayfSentinel 23 дні тому +1

    Hi, i like the content,
    I'm a bit confused about the file path for the testcontainers.ContainerRequest...
    the file path is "./test/integration/test-server/Dockerfile", but the dot means the current directory but the file is inside integration folder...😕

    • @eldr-io
      @eldr-io  22 дні тому

      Hey, yea its a bit confusing but it's actually because that path is relative to the build context of the ContainerRequest, which we've set to the root of the project, and so the dot resolves to the project root and therefore we need the full path to the Dockerfile (from the root). Hope that makes sense

  • @gpltaylor
    @gpltaylor 23 дні тому +1

    Can you post what Nvim plugin you're using for the Terminal?

    • @eldr-io
      @eldr-io  22 дні тому +1

      Sure thing, see the pinned comment