Тёмный

039: Pact HTTP Provider Testing (Golang) 

Testing All The Things
Подписаться 1,6 тыс.
Просмотров 1,7 тыс.
50% 1

The is a second in a series of screencast in which we look at API and Microservice testing framework called Pact and how to use it with Golang for TDD.
In this video we start looking at using Pact to test drive the implementation of a HTTP producer in Golang.
The code produced during this episode can be found on GitHub:
github.com/tes...
You can follow me on twitter: / braddle
** Please Rate, Review, Subscribe and Share these videos **

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@QAAutomated
@QAAutomated Год назад
Hi, I am unable to run the test as it working with docker and I am not familiar with configuring docker. Can you share how can I run it locally without docker.
@TestingAllTheThings
@TestingAllTheThings Год назад
It would be possible to run test without docker however it would take a lot of work you would have to install and config an instance of Postgres to run on your machine and run all the migrations to create the tables. If you can just install docker on you machine it would be easier. I have a make file that would do all the work after that. `make test` would create all the docker instance you need and run the test. if you don't have make you can run the commands yourself `docker build . -t service_test --target=test` - Builds the container `docker-compose up -d` - Starts the container `docker-compose exec -T http go test -tags="integration pact e2e" ./...` - runs the tests on the running container `docker-compose down` - stops the container
@khwarzme
@khwarzme 2 года назад
Thank you for the series, quite helpful When running the e2e tests, why do you have to use docker everytime? I tried running tests directly using go test -v ./... but this totally ignores the e2e directory for some reason. What am i doing wrong?
@TestingAllTheThings
@TestingAllTheThings 2 года назад
The test in the e2e directory do not run with a plain `go test -v ./...` because they have build tags (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QSnSLzeqkDE.html) applied to them they will only run with the correct tags on the test command `go test -v -tags="integration pact e2e" ./...`
@khwarzme
@khwarzme 2 года назад
@@TestingAllTheThings Thank you! I like your channel and will totally start the series from the beginning
@TestingAllTheThings
@TestingAllTheThings 2 года назад
Glad you liked it
@s-guytech9160
@s-guytech9160 2 года назад
Your videos are very helpful. Thank You!. I was wondering, you kinda seeded the database with integration tests, , can i simply seed the db in the pack test suite setup method ?
@TestingAllTheThings
@TestingAllTheThings 2 года назад
Glad you found the videos helpful For the pact tests could could seed the database via the setup methods in the tests or use the state handlers as part of the pact setup. Using the state handers allows you to intercept the setup of the consumer and the given in each of the interactions. For a simple case of a thing being there or not that would probably work. If your responses become more complex (soft delete for example) you might want to jump into the state handlers
@s-guytech9160
@s-guytech9160 2 года назад
@@TestingAllTheThings Thanks for your reply, appreciated.
Далее
038: Pact HTTP Consumer Testing (Golang)
39:36
Просмотров 1,9 тыс.
Bike vs Super Bike Fast Challenge
00:30
Просмотров 22 млн
Что думаете?
00:54
Просмотров 642 тыс.
040: Pact Broker - Pactflow (Golang)
10:04
Просмотров 2,2 тыс.
041: Build Tags (Golang)
5:40
Просмотров 1,2 тыс.
049: Table Driven Tests (Golang)
30:52
Просмотров 853
044: Moq Mocking Framework (Golang)
41:34
Просмотров 763
047 counterfeiter
29:55
Просмотров 373