-
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
Hw12 13 14 15 calendar #14
Conversation
@@ -0,0 +1,85 @@ | |||
version: "2.4" |
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.
Used this version of docker-compose to have an ability to use healthcheck
together with depends_on
"github.com/heetch/confita" | ||
"github.com/heetch/confita/backend/env" | ||
"github.com/heetch/confita/backend/file" | ||
"github.com/ilyakaznacheev/cleanenv" |
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.
I had to migrate to this package, because of problems with confita
heetch/confita#77
@@ -35,10 +35,11 @@ func ConvertTimeToTimestamp(ntime sql.NullTime) (result *timestamp.Timestamp, er | |||
// Didn't want to use reflection. | |||
func ConvertEventToProto(evt repository.Event) (*Event, error) { | |||
result := &Event{ | |||
ID: evt.ID, | |||
UserID: evt.UserID, | |||
ID: int32(evt.ID), |
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.
protocolbuffers/protobuf#2679
strange "feature", so need to move to int/int32
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.
Здравствуйте!
Хорошая работа, ginkgo - огонь.
Принято
10 / 10
) | ||
|
||
var ( | ||
now = time.Now() |
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.
такое бывает опасно при тестах, которые могут идти часами, параллельно и афектить друг друга
бывают очень сложноотловимые баги :( которые лечатся, конечно, переносом этого выражения в более локальную область видимости
return | ||
func NewCalendar(fpath string) (*Calendar, error) { | ||
var cfg Calendar | ||
return &cfg, readConfig(fpath, &cfg) |
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.
красивый приём 👍
только жалко, что приходится тогда возвращать указатель, что в данном случае выглядит сомнительно
} | ||
|
||
func (r *MemoryRepo) GetUser(id int64) (User, error) { | ||
r.mx.Lock() |
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.
RLock?
Домашнее задание №15 «Докеризация и интеграционное тестирование Календаря»
Критерии оценки
make up
/make down
- 3 баллаmake bdd
. Команда возвращает верный код ответа - 1 баллИнтеграционные тесты покрывают бизнес сценарии:
Зачёт от 7 баллов