MG-2187 - Simplify Magistrala core repository (#2338)

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
This commit is contained in:
Dušan Borovčanin
2024-07-15 17:38:48 +02:00
committed by GitHub
parent ffba4ebb8e
commit 5412bddfcf
160 changed files with 15 additions and 17985 deletions
+2 -80
View File
@@ -20,7 +20,6 @@ on:
- "provision/api/**"
- "readers/api/**"
- "things/api/**"
- "twins/api/**"
- "users/api/**"
env:
@@ -36,15 +35,9 @@ env:
AUTH_URL: http://localhost:8189
BOOTSTRAP_URL: http://localhost:9013
CERTS_URL: http://localhost:9019
TWINS_URL: http://localhost:9018
PROVISION_URL: http://localhost:9016
CASSANDRA_READER_URL: http://localhost:9003
INFLUX_READER_URL: http://localhost:9005
MONGO_READER_URL: http://localhost:9007
POSTGRES_READER_URL: http://localhost:9009
TIMESCALE_READER_URL: http://localhost:9011
SMPP_NOTIFIER_URL: http://localhost:9014
SMTP_NOTIFIER_URL: http://localhost:9015
JOURNAL_URL: http://localhost:9021
jobs:
@@ -84,12 +77,12 @@ jobs:
- ".github/workflows/api-tests.yml"
- "api/openapi/journal.yml"
- "journal/api/**"
auth:
- ".github/workflows/api-tests.yml"
- "api/openapi/auth.yml"
- "auth/api/http/**"
bootstrap:
- ".github/workflows/api-tests.yml"
- "api/openapi/bootstrap.yml"
@@ -100,11 +93,6 @@ jobs:
- "api/openapi/certs.yml"
- "certs/api/**"
notifiers:
- ".github/workflows/api-tests.yml"
- "api/openapi/notifiers.yml"
- "consumers/notifiers/api/**"
http:
- ".github/workflows/api-tests.yml"
- "api/openapi/http.yml"
@@ -130,11 +118,6 @@ jobs:
- "api/openapi/things.yml"
- "things/api/**"
twins:
- ".github/workflows/api-tests.yml"
- "api/openapi/twins.yml"
- "twins/api/**"
users:
- ".github/workflows/api-tests.yml"
- "api/openapi/users.yml"
@@ -200,7 +183,6 @@ jobs:
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run Bootstrap API tests
if: steps.changes.outputs.bootstrap == 'true'
uses: schemathesis/action@v1
@@ -221,16 +203,6 @@ jobs:
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run Twins API tests
if: steps.changes.outputs.twins == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/twins.yml
base-url: ${{ env.TWINS_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run Provision API tests
if: steps.changes.outputs.provision == 'true'
uses: schemathesis/action@v1
@@ -247,36 +219,6 @@ jobs:
make cli
./build/cli provision test
- name: Run Cassandra Reader API tests
if: steps.changes.outputs.readers == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/readers.yml
base-url: ${{ env.CASSANDRA_READER_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run Influx Reader API tests
if: steps.changes.outputs.readers == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/readers.yml
base-url: ${{ env.INFLUX_READER_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run Mongo Reader API tests
if: steps.changes.outputs.readers == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/readers.yml
base-url: ${{ env.MONGO_READER_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run Postgres Reader API tests
if: steps.changes.outputs.readers == 'true'
uses: schemathesis/action@v1
@@ -297,26 +239,6 @@ jobs:
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run SMPP Notifier API tests
if: steps.changes.outputs.notifiers == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/notifiers.yml
base-url: ${{ env.SMPP_NOTIFIER_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Run SMTP Notifier API tests
if: steps.changes.outputs.notifiers == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/notifiers.yml
base-url: ${{ env.SMTP_NOTIFIER_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'
- name: Stop containers
if: always()
run: make run down args="-v" && make run_addons down args="-v"
@@ -72,9 +72,6 @@ jobs:
- "certs/certs.go"
- "certs/pki/vault.go"
- "certs/service.go"
- "twins/twins.go"
- "twins/states.go"
- "twins/service.go"
- "journal/journal.go"
- "magistrala/auth_grpc.pb.go"
@@ -148,17 +145,12 @@ jobs:
mv ./users/mocks/hasher.go ./users/mocks/hasher.go.tmp
mv ./mqtt/mocks/events.go ./mqtt/mocks/events.go.tmp
mv ./readers/mocks/messages.go ./readers/mocks/messages.go.tmp
mv ./lora/mocks/routes.go ./lora/mocks/routes.go.tmp
mv ./consumers/notifiers/mocks/notifier.go ./consumers/notifiers/mocks/notifier.go.tmp
mv ./consumers/notifiers/mocks/service.go ./consumers/notifiers/mocks/service.go.tmp
mv ./consumers/notifiers/mocks/repository.go ./consumers/notifiers/mocks/repository.go.tmp
mv ./certs/mocks/certs.go ./certs/mocks/certs.go.tmp
mv ./certs/mocks/pki.go ./certs/mocks/pki.go.tmp
mv ./certs/mocks/service.go ./certs/mocks/service.go.tmp
mv ./twins/mocks/service.go ./twins/mocks/service.go.tmp
mv ./twins/mocks/states.go ./twins/mocks/states.go.tmp
mv ./twins/mocks/repository.go ./twins/mocks/repository.go.tmp
mv ./twins/mocks/cache.go ./twins/mocks/cache.go.tmp
mv ./journal/mocks/repository.go ./journal/mocks/repository.go.tmp
mv ./journal/mocks/service.go ./journal/mocks/service.go.tmp
mv ./auth/mocks/auth_client.go ./auth/mocks/auth_client.go.tmp
@@ -202,17 +194,12 @@ jobs:
check_mock_changes ./users/mocks/hasher.go "Users Hasher ./users/mocks/hasher.go"
check_mock_changes ./mqtt/mocks/events.go "MQTT Events Store ./mqtt/mocks/events.go"
check_mock_changes ./readers/mocks/messages.go "Message Readers ./readers/mocks/messages.go"
check_mock_changes ./lora/mocks/routes.go "LoRa Repository ./lora/mocks/routes.go"
check_mock_changes ./consumers/notifiers/mocks/notifier.go "Notifiers Notifier ./consumers/notifiers/mocks/notifier.go"
check_mock_changes ./consumers/notifiers/mocks/service.go "Notifiers Service ./consumers/notifiers/mocks/service.go"
check_mock_changes ./consumers/notifiers/mocks/repository.go "Notifiers Repository ./consumers/notifiers/mocks/repository.go"
check_mock_changes ./certs/mocks/certs.go "Certs Repository ./certs/mocks/certs.go"
check_mock_changes ./certs/mocks/pki.go "PKI ./certs/mocks/pki.go"
check_mock_changes ./certs/mocks/service.go "Certs Service ./certs/mocks/service.go"
check_mock_changes ./twins/mocks/service.go "Twins Service ./twins/mocks/service.go"
check_mock_changes ./twins/mocks/states.go "Twins States ./twins/mocks/states.go"
check_mock_changes ./twins/mocks/repository.go "Twins Repository ./twins/mocks/repository.go"
check_mock_changes ./twins/mocks/cache.go "Twins Cache ./twins/mocks/cache.go"
check_mock_changes ./journal/mocks/repository.go "Journal Repository ./journal/mocks/repository.go"
check_mock_changes ./journal/mocks/service.go "Journal Service ./journal/mocks/service.go"
check_mock_changes ./auth/mocks/auth_client.go "Auth Service Client ./auth/mocks/auth_client.go"
+1 -44
View File
@@ -108,9 +108,6 @@ jobs:
consumers:
- "consumers/**"
- "cmd/cassandra-writer/**"
- "cmd/influxdb-writer/**"
- "cmd/mongodb-writer/**"
- "cmd/postgres-writer/**"
- "cmd/timescale-writer/**"
- "cmd/smpp-notifier/**"
@@ -149,12 +146,7 @@ jobs:
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/sdk/**"
lora:
- "lora/**"
- "cmd/lora/**"
- "pkg/messaging/**"
logger:
- "logger/**"
@@ -168,11 +160,6 @@ jobs:
- "logger/**"
- "pkg/events/**"
opcua:
- "opcua/**"
- "cmd/opcua/**"
- "logger/**"
pkg-auth:
- "pkg/auth/**"
@@ -207,7 +194,6 @@ jobs:
- "provision/**"
- "readers/**"
- "things/**"
- "twins/**"
- "users/**"
pkg-transformers:
@@ -227,9 +213,6 @@ jobs:
readers:
- "readers/**"
- "cmd/cassandra-reader/**"
- "cmd/influxdb-reader/**"
- "cmd/mongodb-reader/**"
- "cmd/postgres-reader/**"
- "cmd/timescale-reader/**"
- "auth.pb.go"
@@ -248,17 +231,6 @@ jobs:
- "pkg/uuid/**"
- "pkg/events/**"
twins:
- "twins/**"
- "cmd/twins/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/messaging/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "logger/**"
users:
- "users/**"
- "cmd/users/**"
@@ -337,21 +309,11 @@ jobs:
run: |
go test --race -v -count=1 -coverprofile=coverage/logger.out ./logger/...
- name: Run LoRa tests
if: steps.changes.outputs.lora == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/lora.out ./lora/...
- name: Run MQTT tests
if: steps.changes.outputs.mqtt == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/mqtt.out ./mqtt/...
- name: Run OPC-UA tests
if: steps.changes.outputs.opcua == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/opcua.out ./opcua/...
- name: Run pkg auth tests
if: steps.changes.outputs.pkg-auth == 'true' || steps.changes.outputs.workflow == 'true'
run: |
@@ -412,11 +374,6 @@ jobs:
run: |
go test --race -v -count=1 -coverprofile=coverage/things.out ./things/...
- name: Run twins tests
if: steps.changes.outputs.twins == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/twins.out ./twins/...
- name: Run users tests
if: steps.changes.outputs.users == 'true' || steps.changes.outputs.workflow == 'true'
run: |