-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hw15: Тестирование микросервисов #24
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://otus.ru/teacher-lk/homework/23752/7013/
Здравствуйте!
По тестам ок, по их запуску - не ок
Хочется:
- чтобы они проходили
- чтобы не оставляли за собой работающие контейнеры
- посмотрите на скрипты из вебинара, или отсюда, например
https://github.com/OtusGolang/webinars_practical_part/blob/master/31-integration-testing/Makefile
Предварительно
6 / 10
hw12_13_14_15_calendar/Makefile
Outdated
docker-compose -f docker/docker-compose.yaml down | ||
|
||
bdd: | ||
docker-compose -f docker/docker-compose.yaml run --rm bdd-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
при ошибке получаем работающий compose
например, у меня был занят 8080 порт, тесты оставили после себя мусорные запущенные контейнеры
ERROR: for server Cannot start service server: driver failed programming external connectivity on endpoint calendar-server (45b63f6aeefb1a0fadb61cf577e9391f451a1d4c3cc95e34544a01daa10921f1): Bind for 0.0.0.0:8080 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.
make: *** [bdd] Error 1
кстати, чтобы такого не происходило, в ports
стоит указывать хост тоже. чтобы сервить на localhost, а не 0.0.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал бинд на localhost.
down: | ||
docker-compose -f docker/docker-compose.yaml down | ||
|
||
bdd: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не прошли + оставили после себя мусор
▶ make bdd
docker-compose -f docker/docker-compose.yaml run --rm bdd-tests
Creating network "docker_postgres" with driver "bridge"
Creating network "docker_rabbit" with driver "bridge"
Creating network "docker_default" with the default driver
Creating network "docker_server" with driver "bridge"
Creating docker_postgres-golang-learning_1 ... done
Creating docker_calendar-base-image_1 ... done
Creating docker_rabbitmq-golang-learning_1 ... done
Creating calendar-sender ... done
Creating calendar-server ... done
Creating calendar-scheduler ... done
Creating docker_bdd-tests_run ... done
....F.......................................... 47
--- Failed steps:
Scenario: Check upcoming event # features/events_notify.feature:4
Then received true status # features/events_notify.feature:9
Error: no notified messages
11 scenarios (10 passed, 1 failed)
47 steps (46 passed, 1 failed)
10.580727s
make: *** [bdd] Error 1
логов явно не хватает
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Речь именно про сохранение вывода в файл?
Progress output, на первый взгляд, весьма удобная и читаемая штука.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тесты также поправил (на самом деле нужны были healthcheck).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я имел в виду стектрейс до места, где именно упали тесты
ENV GOOS=linux | ||
|
||
VOLUME /app/godogs | ||
RUN go get -u github.com/cucumber/godog/cmd/godog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если есть vendor, то можно из него собирать, чтобы быстрее было
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для godog не нашел чего-то свежего и звездного в docker hub :(
s.Step(`^update event with global ID and title "([^"]*)"$`, updateEventWithGlobalIDAndTitle) | ||
} | ||
|
||
// var opts = godog.Options{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мертвый код убираем
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрал :)
* fix make bdd: use chealthcheck in modules * move docker files into deplyments * make bdd call build and up * clean comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Огонь!
8 / 10
Домашнее задание №15 «Докеризация и интеграционное тестирование Календаря»
Критерии оценки
make up
/make down
- 3 баллаmake bdd
. Команда возвращает верный код ответа - 1 баллИнтеграционные тесты покрывают бизнес сценарии:
Зачёт от 7 баллов