This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker-compose -f docker-compose-tests.yml up --build --abort-on-container-exit --exit-code-from app 2> /dev/null | |
if [ $? -eq 0 ] | |
then | |
docker-compose -f docker-compose-tests.yml down --volumes | |
echo "Application tests success" | |
else | |
docker-compose -f docker-compose-tests.yml down --volumes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
networks: | |
integration-tests: | |
driver: bridge | |
services: | |
app: | |
build: | |
context: . | |
dockerfile: Dockerfile.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG GO_VERSION=1.13.4 | |
FROM golang:${GO_VERSION}-alpine | |
RUN apk add --no-cache ca-certificates git | |
RUN apk add mysql mysql-client | |
WORKDIR /main | |
COPY go.mod go.sum ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RESULT=$(CGO_ENABLED=0 go test ./cmd/integrationtests -count=1 2> /dev/null) | |
if [ $? -ne 0 ]; then | |
echo "Test errors: $RESULT" >&2 | |
exit 1 | |
else | |
echo "Test success: $RESULT" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ -z "$1" || -z "$2" ]]; then | |
{ echo "empty parameters $1 - MYSQL_HOST $2 - after run script"; exit 1; } | |
fi | |
MYSQL_HOST=$1 | |
SECONDS_CHECK=40 | |
echo "Check db: $MYSQL_HOST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Test(t *testing.T) { | |
response := struct { | |
Success string `json:"success"` | |
}{} | |
requestHelper( | |
t, | |
"POST", | |
"/write", | |
strings.NewReader(`{"message":"text"}`), | |
&response, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.GET("/read", s.read) | |
router.POST("/write", s.write) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Server struct { | |
Router *httprouter.Router | |
storage database.Storage | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
xcode-select --install | |
brew install cask | |
brew install git-lfs | |
brew install ffmpeg | |
brew install imagemagick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func heightForModel(dataModel: DataModel) -> CGFloat { | |
let stringHeight = calculateHeightForText(dataModel.text) | |
let commentsHeight = dataModel.comments.count > 0 ? Constant.commentsPanelHeight : 0 | |
return Constats.topPadding + Constants.titleHeight + stringHeight + commentsHeight | |
} |