Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**/.gradle
**/build
**/out
**/.idea
**/*.iml
**/.DS_Store
**/node_modules
**/dist
**/.screen-output
**/.allure
**/logs
5 changes: 3 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_SHA }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
docker pull twilio/selenoid:chrome_stable_140
- name: Get the last commit message
run: |
echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> $GITHUB_ENV
echo "HEAD_COMMIT_MESSAGE=$(git log -1 --format=%s ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
- name: Prepare screenshot dir
run: |
mkdir -p niffler-e-2-e-tests/.screen-output/screenshots/selenoid
Expand Down
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ User-MacBook-Pro ~ % docker -v
Docker version 20.10.14, build a224086
```

#### 2. Спуллить контейнер postgres:15.1, zookeeper и kafka версии 7.3.2
#### 2. Спуллить контейнер postgres:15.1, zookeeper и kafka версии 7.7.7

```posh
docker pull postgres:15.1
docker pull confluentinc/cp-zookeeper:7.3.2
docker pull confluentinc/cp-kafka:7.3.2
docker pull confluentinc/cp-zookeeper:7.7.7
docker pull confluentinc/cp-kafka:7.7.7
```

После `pull` вы увидите спуленный image командой `docker images`
Expand All @@ -89,8 +89,8 @@ docker pull confluentinc/cp-kafka:7.3.2
mitriis-MacBook-Pro ~ % docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
postgres 15.1 9f3ec01f884d 10 days ago 379MB
confluentinc/cp-kafka 7.3.2 db97697f6e28 12 months ago 457MB
confluentinc/cp-zookeeper 7.3.2 6fe5551964f5 7 years ago 451MB
confluentinc/cp-kafka 7.7.7 db97697f6e28 12 months ago 457MB
confluentinc/cp-zookeeper 7.7.7 6fe5551964f5 7 years ago 451MB

```

Expand All @@ -100,6 +100,21 @@ confluentinc/cp-zookeeper 7.3.2 6fe5551964f5 7 years ago 451MB
docker volume create pgdata
```

#### 4.0 Если у вас ОС Windows:

Необходимо выполнить следующие команды в каталоге /postgres/script :
```
sed -i -e 's/\r$//' init-database.sh
chmod +x init-database.sh
```

Также необходимо исправить команду в скрипте localenv.sh (в корне проекта):

```diff
- docker run --name niffler-all -p 5432:5432 -e POSTGRES_PASSWORD=secret -v pgdata:/var/lib/postgresql/data -v ./postgres/script:/docker-entrypoint-initdb.d -e CREATE_DATABASES=niffler-auth,niffler-currency,niffler-spend,niffler-userdata -e TZ=GMT+3 -e PGTZ=GMT+3 -d postgres:15.1 --max_prepared_transactions=100
+ docker run --name niffler-all -p 5432:5432 -e POSTGRES_PASSWORD=secret -v pgdata:/var/lib/postgresql/data -v /$(pwd)/postgres/script:/docker-entrypoint-initdb.d -e CREATE_DATABASES=niffler-auth,niffler-currency,niffler-spend,niffler-userdata -e TZ=GMT+3 -e PGTZ=GMT+3 -d postgres:15.1 --max_prepared_transactions=100
```

#### 4. Запустить БД, zookeeper и kafka 3-мя последовательными командами:

Запустив скрипт (Для Windows необходимо использовать bash terminal: gitbash, cygwin или wsl)
Expand All @@ -113,44 +128,29 @@ User-MacBook-Pro niffler % bash localenv.sh
```posh
docker run --name niffler-all -p 5432:5432 -e POSTGRES_PASSWORD=secret -e CREATE_DATABASES=niffler-auth,niffler-currency,niffler-spend,niffler-userdata -e TZ=GMT+3 -e PGTZ=GMT+3 -v pgdata:/var/lib/postgresql/data -v ./postgres/script:/docker-entrypoint-initdb.d -d postgres:15.1 --max_prepared_transactions=100

docker run --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 -d confluentinc/cp-zookeeper:7.3.2
docker run --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 -d confluentinc/cp-zookeeper:7.7.7

docker run --name=kafka -e KAFKA_BROKER_ID=1 \
-e KAFKA_ZOOKEEPER_CONNECT=$(docker inspect zookeeper --format='{{ .NetworkSettings.IPAddress }}'):2181 \
-e KAFKA_ZOOKEEPER_CONNECT=$(docker inspect zookeeper --format='{{ .NetworkSettings.Networks.bridge.IPAddress }}'):2181 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 \
-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
-e KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 \
-e KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 \
-p 9092:9092 -d confluentinc/cp-kafka:7.3.2
-p 9092:9092 -d confluentinc/cp-kafka:7.7.7
```

Для Windows (Необходимо использовать bash terminal: gitbash, cygwin или wsl):

```posh
docker run --name niffler-all -p 5432:5432 -e POSTGRES_PASSWORD=secret -e CREATE_DATABASES=niffler-auth,niffler-currency,niffler-spend,niffler-userdata -e TZ=GMT+3 -e PGTZ=GMT+3 -v pgdata:/var/lib/postgresql/data -v ./postgres/script:/docker-entrypoint-initdb.d -d postgres:15.1 --max_prepared_transactions=100
docker run --name niffler-all -p 5432:5432 -e POSTGRES_PASSWORD=secret -e CREATE_DATABASES=niffler-auth,niffler-currency,niffler-spend,niffler-userdata -e TZ=GMT+3 -e PGTZ=GMT+3 -v pgdata:/var/lib/postgresql/data -v /$(pwd)/postgres/script:/docker-entrypoint-initdb.d -d postgres:15.1 --max_prepared_transactions=100

docker run --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 -d confluentinc/cp-zookeeper:7.3.2
docker run --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 -d confluentinc/cp-zookeeper:7.7.7

docker run --name=kafka -e KAFKA_BROKER_ID=1 -e KAFKA_ZOOKEEPER_CONNECT=$(docker inspect zookeeper --format="{{ .NetworkSettings.IPAddress }}"):2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 -e KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 -e KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 -p 9092:9092 -d confluentinc/cp-kafka:7.3.2
docker run --name=kafka -e KAFKA_BROKER_ID=1 -e KAFKA_ZOOKEEPER_CONNECT=$(docker inspect zookeeper --format="{{ .NetworkSettings.Networks.bridge.IPAddress }}"):2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 -e KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 -e KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 -p 9092:9092 -d confluentinc/cp-kafka:7.7.7
```

[Про IP zookeeper](https://github.com/confluentinc/cp-docker-images/issues/801#issuecomment-692085103)

Если вы используете Windows и контейнер с БД не стартует с ошибкой в логе:

```
server started
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init-database.sh
/usr/local/bin/docker-entrypoint.sh: /docker-entrypoint-initdb.d/init-database.sh: /bin/bash^M: bad interpreter: No such file or directory
```

То необходимо выполнить следующие команды в каталоге /postgres/script :

```
sed -i -e 's/\r$//' init-database.sh
chmod +x init-database.sh
```

#### 5. Установить Java версии 21. Это необходимо, т.к. проект использует синтаксис Java 21

Версию установленной Java необходимо проверить командой `java -version`
Expand Down Expand Up @@ -401,4 +401,4 @@ User-MacBook-Pro niffler % bash docker-compose-e2e.sh

#### 5. Allure report доступен по адресу: http://localhost:5050/allure-docker-service/projects/niffler-ng/reports/latest/index.html

<img src="./niffler-ng-client/src/assets/images/niffler-with-a-coin.png" width="250">
<img src="./niffler-ng-client/src/assets/images/niffler-with-a-coin.png" width="250">
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ plugins {

group = 'guru.qa'

wrapper {
gradleVersion = '9.2.1'
}

allprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
Expand All @@ -31,7 +35,7 @@ subprojects {
springOpenApiVersion = '2.8.13'
webauthn4jVersion = '0.29.7.RELEASE'
postgresDriverVersion = '42.7.8'
flywayVersion = '11.14.1'
flywayVersion = '11.19.1'
springGrpcVersion = '3.1.0.RELEASE'
springGraphqlDateTimeVersion = '6.0.0'
springSecurityTestVersion = '6.5.6'
Expand All @@ -43,7 +47,7 @@ subprojects {
thumbnailatorVersion = '0.4.21'
apacheCsvVersion = '1.14.1'
h2Version = '2.4.240'
mockitoVersion = '5.20.0'
mockitoVersion = '5.21.0'

dockerImage = System.getProperty("os.arch") == "aarch64" || System.getProperty("os.arch") == "arm64"
? "arm64v8/eclipse-temurin:21-jdk"
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:

zookeeper:
container_name: zookeeper
image: confluentinc/cp-zookeeper:7.3.2
image: confluentinc/cp-zookeeper:7.7.7
ports:
- 2181:2181
environment:
Expand All @@ -33,7 +33,7 @@ services:

kafka:
container_name: kafka
image: confluentinc/cp-kafka:7.3.2
image: confluentinc/cp-kafka:7.7.7
ports:
- 9092:9092
depends_on:
Expand Down Expand Up @@ -194,7 +194,7 @@ services:
- HEAD_COMMIT_MESSAGE=${HEAD_COMMIT_MESSAGE}
- EXECUTION_TYPE=${EXECUTION_TYPE}
volumes:
- ./niffler-e-2-e-tests/.screen-output/screenshots/selenoid:/niffler/niffler-e-2-e-tests/.screen-output/screenshots/selenoid
- ./niffler-e-2-e-tests/.screen-output/screenshots/selenoid:/home/gradle/niffler/niffler-e-2-e-tests/.screen-output/screenshots/selenoid
depends_on:
frontend.niffler.dc:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions localenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

docker run --name niffler-all -p 5432:5432 -e POSTGRES_PASSWORD=secret -v pgdata:/var/lib/postgresql/data -v ./postgres/script:/docker-entrypoint-initdb.d -e CREATE_DATABASES=niffler-auth,niffler-currency,niffler-spend,niffler-userdata -e TZ=GMT+3 -e PGTZ=GMT+3 -d postgres:15.1 --max_prepared_transactions=100
docker run --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 -d confluentinc/cp-zookeeper:7.3.2
docker run --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 -d confluentinc/cp-zookeeper:7.7.7
docker run --name=kafka -e KAFKA_BROKER_ID=1 \
-e KAFKA_ZOOKEEPER_CONNECT=$(docker inspect zookeeper --format='{{ .NetworkSettings.IPAddress }}'):2181 \
-e KAFKA_ZOOKEEPER_CONNECT=$(docker inspect zookeeper --format='{{ .NetworkSettings.Networks.bridge.IPAddress }}'):2181 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 \
-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
-e KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 \
-e KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 \
-p 9092:9092 -d confluentinc/cp-kafka:7.3.2
-p 9092:9092 -d confluentinc/cp-kafka:7.7.7
4 changes: 2 additions & 2 deletions niffler-auth/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'org.springframework.boot' version '3.5.6'
id 'org.springframework.boot' version '3.5.8'
id 'com.google.cloud.tools.jib' version '3.4.1'
}

group = 'guru.qa'
version = '2.5.3'
version = '2.5.4'

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
Expand Down
4 changes: 2 additions & 2 deletions niffler-currency/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'org.springframework.boot' version '3.5.6'
id 'org.springframework.boot' version '3.5.8'
id 'com.google.cloud.tools.jib' version '3.4.1'
}

group = 'guru.qa'
version = '2.0.6'
version = '2.0.7'

dependencies {
implementation project(':niffler-grpc-common')
Expand Down
8 changes: 3 additions & 5 deletions niffler-e-2-e-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM eclipse-temurin:21-jdk
FROM gradle:9.2.1-jdk21

WORKDIR /niffler
WORKDIR /home/gradle/niffler
ENV TZ=Europe/Moscow
COPY ./gradle ./gradle
COPY ./niffler-e-2-e-tests ./niffler-e-2-e-tests
COPY ./niffler-grpc-common ./niffler-grpc-common
COPY ./gradlew ./
COPY ./build.gradle ./
COPY ./settings.gradle ./
COPY ./gradle.properties ./

CMD ./gradlew test -p niffler-e-2-e-tests -Dtest.env=docker -Drepository=jpa -Duser.timezone=Europe/Moscow
CMD gradle test -p niffler-e-2-e-tests -Dtest.env=docker -Drepository=jpa -Duser.timezone=Europe/Moscow
50 changes: 27 additions & 23 deletions niffler-e-2-e-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
buildscript {
ext {
junitVersion = '5.13.4'
allureVersion = '2.30.0'
selenideVersion = '7.11.1'
okhttp3Version = '5.2.1'
junitVersion = '5.14.1'
allureVersion = '2.32.0'
aspectJVersion = '1.9.22'
selenideVersion = '7.13.0'
okhttp3Version = '5.3.2'
retrofitVersion = '3.0.0'
apollographqlVersion = '0.0.2'
logbackVersion = '1.5.20'
logbackVersion = '1.5.22'
slf4jVersion = '2.0.17'
springJdbcVersion = '6.2.12'
springCryptoVersion = '6.5.6'
p6spyVersion = '3.9.1'
hibernateVersion = '7.1.1.Final'
kafkaClientsVersion = '4.1.0'
hibernateVersion = '7.2.0.Final'
kafkaClientsVersion = '4.1.1'
saajVersion = '3.0.4'
springDataCommonsVersion = '3.5.5'
wiremockVersion = '3.13.1'
wiremockVersion = '3.13.2'
ashotVersion = '1.5.4'
fakerVersion = '1.0.2'
userdataWsdlUrl = System.getProperty("test.env") == "docker"
Expand All @@ -28,20 +29,19 @@ buildscript {
}

plugins {
id 'io.qameta.allure' version '3.0.0'
id 'io.qameta.allure-adapter' version '3.0.0'
id 'io.qameta.allure' version '3.0.1'
id 'io.qameta.allure-adapter' version '3.0.1'
id 'com.github.edeandrea.xjc-generation' version '1.6'
id 'com.apollographql.apollo' version '4.3.3'
}

group = 'guru.qa'
version = '2.1.4'
version = '2.1.5'

allure {
version.set("${allureVersion}")
adapter {
aspectjVersion.set("1.9.22")
aspectjWeaver.set(true)
configurations {
agent {
canBeResolved = true
canBeConsumed = true
}
}

Expand Down Expand Up @@ -87,7 +87,8 @@ dependencies {
testImplementation "ch.qos.logback:logback-classic:${logbackVersion}"
testImplementation "org.slf4j:slf4j-api:${slf4jVersion}"
// JUnit
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
testImplementation platform("org.junit:junit-bom:${junitVersion}")
testImplementation "org.junit.jupiter:junit-jupiter"
// REST
testImplementation "com.squareup.okhttp3:logging-interceptor:${okhttp3Version}"
testImplementation "com.squareup.okhttp3:okhttp-urlconnection:${okhttp3Version}"
Expand All @@ -111,23 +112,25 @@ dependencies {
testImplementation "org.hibernate:hibernate-core:${hibernateVersion}"
testImplementation "org.springframework.security:spring-security-crypto:${springCryptoVersion}"
// Allure
testImplementation "io.qameta.allure:allure-attachments:${allureVersion}"
testImplementation("io.qameta.allure:allure-junit5:${allureVersion}") {
agent "org.aspectj:aspectjweaver:${aspectJVersion}"
testImplementation platform("io.qameta.allure:allure-bom:$allureVersion")
testImplementation "io.qameta.allure:allure-attachments"
testImplementation "io.qameta.allure:allure-okhttp3"
testImplementation "io.qameta.allure:allure-grpc"
testImplementation("io.qameta.allure:allure-junit5") {
exclude group: "org.junit.jupiter"
}
testImplementation("io.qameta.allure:allure-selenide:${allureVersion}") {
testImplementation("io.qameta.allure:allure-selenide") {
exclude group: 'com.codeborne'
}
testImplementation "io.qameta.allure:allure-okhttp3:${allureVersion}"
testImplementation "io.qameta.allure:allure-grpc:${allureVersion}"
// WEB
testImplementation "com.codeborne:selenide:${selenideVersion}"
testImplementation "ru.yandex.qatools.ashot:ashot:${ashotVersion}"
// Utils
testImplementation("com.github.javafaker:javafaker:${fakerVersion}") {
exclude group: 'org.yaml'
}
testImplementation 'commons-io:commons-io:2.20.0'
testImplementation 'commons-io:commons-io:2.21.0'
testImplementation 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation 'com.github.vertical-blank:sql-formatter:2.0.5'
// gRPC
Expand Down Expand Up @@ -167,4 +170,5 @@ tasks.named { it == "generateNifflerApolloSources" }.configureEach {

test {
dependsOn("generateNifflerApolloSources")
jvmArgs = [ "-javaagent:${configurations.agent.singleFile}" ]
}
4 changes: 2 additions & 2 deletions niffler-gateway/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id 'org.springframework.boot' version '3.5.6'
id 'org.springframework.boot' version '3.5.8'
id 'com.google.cloud.tools.jib' version '3.4.1'
id 'com.github.edeandrea.xjc-generation' version '1.6'
}

group = 'guru.qa'
version = '2.4.2'
version = '2.4.3'

dependencies {
implementation project(':niffler-grpc-common')
Expand Down
4 changes: 2 additions & 2 deletions niffler-ng-client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM node:22.6.0-alpine AS build
ARG NPM_COMMAND
ARG VERSION
WORKDIR /app
COPY package.json ./
RUN npm install
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY . ./
RUN npm run ${NPM_COMMAND}

Expand Down
Loading
Loading