From a23d6cfaeb5084ea9e19f560c32e22689a1db80e Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 21:34:14 +0200 Subject: [PATCH 01/18] Fix tests --- .github/workflows/e2e.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1c299fd7f6..a0eda82dd6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,9 +1,9 @@ name: E2E -on: - push: - branches: - - master - pull_request: +# on: +# push: +# branches: +# - master +# pull_request: jobs: build: name: E2E From 1023bea80dc7e5673b55ec0b42d04d97e9ca8ed3 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 21:53:05 +0200 Subject: [PATCH 02/18] Fix tests --- client/amqp/integration_test.go | 27 +++++++++++++++-- .../async/kafka/group/integration_test.go | 10 +++++-- .../async/kafka/simple/integration_test.go | 30 +++++++++++++++---- test/amqp/amqp.go | 28 ----------------- test/kafka/kafka.go | 8 ----- 5 files changed, 57 insertions(+), 46 deletions(-) delete mode 100644 test/amqp/amqp.go diff --git a/client/amqp/integration_test.go b/client/amqp/integration_test.go index 5b88a72111..3410668199 100644 --- a/client/amqp/integration_test.go +++ b/client/amqp/integration_test.go @@ -7,7 +7,6 @@ import ( "context" "testing" - testamqp "github.com/beatlabs/patron/test/amqp" "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" "github.com/opentracing/opentracing-go/mocktracer" @@ -27,7 +26,7 @@ func TestRun(t *testing.T) { opentracing.SetGlobalTracer(mtr) t.Cleanup(func() { mtr.Reset() }) - require.NoError(t, testamqp.CreateQueue(endpoint, queue)) + require.NoError(t, createQueue(endpoint, queue)) pub, err := New(endpoint) require.NoError(t, err) @@ -72,3 +71,27 @@ func TestRun(t *testing.T) { assert.NoError(t, channel.Close()) assert.NoError(t, conn.Close()) } + +func createQueue(endpoint, queue string) error { + conn, err := amqp.Dial(endpoint) + if err != nil { + return err + } + + channel, err := conn.Channel() + if err != nil { + return err + } + + _, err = channel.QueueDelete(queue, false, false, false) + if err != nil { + return err + } + + _, err = channel.QueueDeclare(queue, true, false, false, false, nil) + if err != nil { + return err + } + + return nil +} diff --git a/component/async/kafka/group/integration_test.go b/component/async/kafka/group/integration_test.go index c12bc07870..b8f313b4fd 100644 --- a/component/async/kafka/group/integration_test.go +++ b/component/async/kafka/group/integration_test.go @@ -72,7 +72,10 @@ func TestGroupConsume(t *testing.T) { messages := make([]*sarama.ProducerMessage, 0, len(sent)) for _, val := range sent { - messages = append(messages, testkafka.CreateProducerMessage(groupTopic1, val)) + messages = append(messages, &sarama.ProducerMessage{ + Topic: groupTopic1, + Value: sarama.StringEncoder(val), + }) } err := testkafka.SendMessages(broker, messages...) @@ -118,7 +121,10 @@ func TestGroupConsume_ClaimMessageError(t *testing.T) { time.Sleep(5 * time.Second) - err = testkafka.SendMessages(broker, testkafka.CreateProducerMessage(groupTopic2, "321")) + err = testkafka.SendMessages(broker, &sarama.ProducerMessage{ + Topic: groupTopic2, + Value: sarama.StringEncoder("321"), + }) require.NoError(t, err) select { diff --git a/component/async/kafka/simple/integration_test.go b/component/async/kafka/simple/integration_test.go index 3fb5507e69..d54b0f70ed 100644 --- a/component/async/kafka/simple/integration_test.go +++ b/component/async/kafka/simple/integration_test.go @@ -65,7 +65,10 @@ func TestSimpleConsume(t *testing.T) { messages := make([]*sarama.ProducerMessage, 0, len(sent)) for _, val := range sent { - messages = append(messages, testkafka.CreateProducerMessage(simpleTopic1, val)) + messages = append(messages, &sarama.ProducerMessage{ + Topic: simpleTopic1, + Value: sarama.StringEncoder(val), + }) } err := testkafka.SendMessages(broker, messages...) @@ -117,7 +120,10 @@ func TestSimpleConsume_ClaimMessageError(t *testing.T) { time.Sleep(5 * time.Second) - err := testkafka.SendMessages(broker, testkafka.CreateProducerMessage(simpleTopic2, "123")) + err := testkafka.SendMessages(broker, &sarama.ProducerMessage{ + Topic: simpleTopic2, + Value: sarama.StringEncoder("123"), + }) require.NoError(t, err) select { @@ -141,7 +147,10 @@ func TestSimpleConsume_WithDurationOffset(t *testing.T) { messages := make([]*sarama.ProducerMessage, 0) for _, val := range sent { - messages = append(messages, testkafka.CreateProducerMessage(simpleTopic3, val)) + messages = append(messages, &sarama.ProducerMessage{ + Topic: simpleTopic3, + Value: sarama.StringEncoder(val), + }) } err := testkafka.SendMessages(broker, messages...) @@ -206,7 +215,10 @@ func TestSimpleConsume_WithTimestampOffset(t *testing.T) { messages := make([]*sarama.ProducerMessage, 0) for i, tm := range times { val := sent[i] - msg := testkafka.CreateProducerMessage(simpleTopic6, val) + msg := &sarama.ProducerMessage{ + Topic: simpleTopic6, + Value: sarama.StringEncoder(val), + } msg.Timestamp = tm messages = append(messages, msg) } @@ -263,7 +275,10 @@ func TestSimpleConsume_WithNotificationOnceReachingLatestOffset(t *testing.T) { messages := make([]*sarama.ProducerMessage, 0) numberOfMessages := 10 for i := 0; i < numberOfMessages; i++ { - messages = append(messages, testkafka.CreateProducerMessage(simpleTopic4, "foo")) + messages = append(messages, &sarama.ProducerMessage{ + Topic: simpleTopic4, + Value: sarama.StringEncoder("foo"), + }) } err := testkafka.SendMessages(broker, messages...) @@ -379,7 +394,10 @@ func TestSimpleConsume_WithNotificationOnceReachingLatestOffset_WithTimestampOff messages := make([]*sarama.ProducerMessage, 0) for i, tm := range times { val := sent[i] - msg := testkafka.CreateProducerMessage(simpleTopic7, val) + msg := &sarama.ProducerMessage{ + Topic: simpleTopic7, + Value: sarama.StringEncoder(val), + } msg.Timestamp = tm messages = append(messages, msg) } diff --git a/test/amqp/amqp.go b/test/amqp/amqp.go deleted file mode 100644 index 3c5587a16a..0000000000 --- a/test/amqp/amqp.go +++ /dev/null @@ -1,28 +0,0 @@ -package amqp - -import "github.com/streadway/amqp" - -// CreateQueue helper function. -func CreateQueue(endpoint, queue string) error { - conn, err := amqp.Dial(endpoint) - if err != nil { - return err - } - - channel, err := conn.Channel() - if err != nil { - return err - } - - _, err = channel.QueueDelete(queue, false, false, false) - if err != nil { - return err - } - - _, err = channel.QueueDeclare(queue, true, false, false, false, nil) - if err != nil { - return err - } - - return nil -} diff --git a/test/kafka/kafka.go b/test/kafka/kafka.go index 2169c836a8..b05112b508 100644 --- a/test/kafka/kafka.go +++ b/test/kafka/kafka.go @@ -128,11 +128,3 @@ func AsyncConsumeMessages(consumer async.Consumer, expectedMessageCount int) ([] } } } - -// CreateProducerMessage for a topic. -func CreateProducerMessage(topic, message string) *sarama.ProducerMessage { - return &sarama.ProducerMessage{ - Topic: topic, - Value: sarama.StringEncoder(message), - } -} From e8ede16173fd7fd5142b2d20f3191b973c81f9d7 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 22:18:27 +0200 Subject: [PATCH 03/18] Fix tests --- docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f70af952d5..883bd79b0e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.8" services: zookeeper: image: bitnami/zookeeper:latest @@ -60,7 +59,7 @@ services: volumes: - "redis_data:/bitnami/redis/data" localstack: - image: localstack/localstack:latest + image: localstack/localstack:3 ports: - "127.0.0.1:4566:4566" # LocalStack Gateway - "127.0.0.1:4510-4559:4510-4559" # external services port range @@ -71,7 +70,7 @@ services: - "${TMPDIR:-/tmp}/localstack:/var/lib/localstack" - "/var/run/docker.sock:/var/run/docker.sock" hivemq: - image: hivemq/hivemq4:latest + image: hivemq/hivemq4:4.26.0 restart: always ports: - target: 1883 From c4e9a8fa75a7314f7a65016af67e2bed57bec5c0 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 22:23:01 +0200 Subject: [PATCH 04/18] Fix tests --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 883bd79b0e..1839d87178 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -86,7 +86,7 @@ services: HIVEMQ_CONTROL_CENTER_PASSWORD: "123456" HIVEMQ_CLUSTER_TRANSPORT_TYPE: "TCP" mongo: - image: mongo:5 + image: mongo:7 restart: always ports: - "27017:27017" From d5aadf69aeedd1d05010312a556a2d933d59f5d3 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 22:37:43 +0200 Subject: [PATCH 05/18] Fix tests --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1839d87178..d3167b7fbb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,7 @@ services: depends_on: - zookeeper rabbitmq: - image: docker.io/bitnami/rabbitmq:latest + image: docker.io/bitnami/rabbitmq:3.12 ports: - '4369:4369' - '5551:5551' From 14eba235b01d749088211bccc6484b54e7fdb8b4 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 22:45:28 +0200 Subject: [PATCH 06/18] Fix tests --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d3167b7fbb..b3e0959d4b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: environment: - ALLOW_ANONYMOUS_LOGIN=yes kafka: - image: bitnami/kafka:2 + image: bitnami/kafka:3 ports: - "9092:9092" - "9093:9093" From 5e67378a6fefb3589965fa15970daeaf5b52673e Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sat, 16 Mar 2024 23:03:28 +0200 Subject: [PATCH 07/18] Fix tests --- client/kafka/integration_test.go | 2 +- .../async/kafka/group/integration_test.go | 2 +- .../async/kafka/simple/integration_test.go | 2 +- component/kafka/integration_test.go | 2 +- docker-compose.yml | 38 +++++++++++-------- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/client/kafka/integration_test.go b/client/kafka/integration_test.go index 8e8e33b3c6..ca8dcd29b8 100644 --- a/client/kafka/integration_test.go +++ b/client/kafka/integration_test.go @@ -19,7 +19,7 @@ const ( clientTopic = "clientTopic" ) -var brokers = []string{"127.0.0.1:9093"} +var brokers = []string{"127.0.0.1:9092"} func TestNewAsyncProducer_Success(t *testing.T) { saramaCfg, err := DefaultProducerSaramaConfig("test-producer", true) diff --git a/component/async/kafka/group/integration_test.go b/component/async/kafka/group/integration_test.go index b8f313b4fd..758d89dd37 100644 --- a/component/async/kafka/group/integration_test.go +++ b/component/async/kafka/group/integration_test.go @@ -30,7 +30,7 @@ const ( successTopic1 = "successTopic1" failAllRetriesTopic1 = "failAllRetriesTopic1" failAndRetryTopic1 = "failAndRetryTopic1" - broker = "127.0.0.1:9093" + broker = "127.0.0.1:9092" ) func TestGroupConsume(t *testing.T) { diff --git a/component/async/kafka/simple/integration_test.go b/component/async/kafka/simple/integration_test.go index d54b0f70ed..422b4cb4dc 100644 --- a/component/async/kafka/simple/integration_test.go +++ b/component/async/kafka/simple/integration_test.go @@ -24,7 +24,7 @@ const ( simpleTopic5 = "simpleTopic5" simpleTopic6 = "simpleTopic6" simpleTopic7 = "simpleTopic7" - broker = "127.0.0.1:9093" + broker = "127.0.0.1:9092" ) func TestSimpleConsume(t *testing.T) { diff --git a/component/kafka/integration_test.go b/component/kafka/integration_test.go index fefc664678..b4efdb0de6 100644 --- a/component/kafka/integration_test.go +++ b/component/kafka/integration_test.go @@ -29,7 +29,7 @@ const ( successTopic2 = "successTopic2" failAllRetriesTopic2 = "failAllRetriesTopic2" failAndRetryTopic2 = "failAndRetryTopic2" - broker = "127.0.0.1:9093" + broker = "127.0.0.1:9092" groupSuffix = "-group" ) diff --git a/docker-compose.yml b/docker-compose.yml index b3e0959d4b..ec31e448cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,24 +1,30 @@ services: - zookeeper: - image: bitnami/zookeeper:latest - ports: - - "2181:2181" - environment: - - ALLOW_ANONYMOUS_LOGIN=yes kafka: - image: bitnami/kafka:3 + image: confluentinc/cp-kafka:7.6.0 + hostname: broker + container_name: broker ports: - "9092:9092" - - "9093:9093" + - "9101:9101" environment: - - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 - - ALLOW_PLAINTEXT_LISTENER=yes - - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT - - KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093 - - KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093 - - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT - depends_on: - - zookeeper + KAFKA_NODE_ID: 1 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT' + KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092' + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 + KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 + KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 + KAFKA_JMX_PORT: 9101 + KAFKA_JMX_HOSTNAME: localhost + KAFKA_PROCESS_ROLES: 'broker,controller' + KAFKA_CONTROLLER_QUORUM_VOTERS: '1@broker:29093' + KAFKA_LISTENERS: 'PLAINTEXT://broker:29092,CONTROLLER://broker:29093,PLAINTEXT_HOST://0.0.0.0:9092' + KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT' + KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER' + KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs' + # Replace CLUSTER_ID with a unique base64 UUID using "bin/kafka-storage.sh random-uuid" + # See https://docs.confluent.io/kafka/operations-tools/kafka-tools.html#kafka-storage-sh + CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk' rabbitmq: image: docker.io/bitnami/rabbitmq:3.12 ports: From 2802a1d19e56d0df5bc9877b354ac5fc44f529af Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 09:50:50 +0200 Subject: [PATCH 08/18] Fix tests --- examples/README.md | 2 +- examples/docker-compose.yml | 56 ------------------------------------- examples/examples.go | 2 +- 3 files changed, 2 insertions(+), 58 deletions(-) delete mode 100644 examples/docker-compose.yml diff --git a/examples/README.md b/examples/README.md index 6b5c0b4457..1c7ee1a388 100644 --- a/examples/README.md +++ b/examples/README.md @@ -16,7 +16,7 @@ The client implements all Patron clients for the components used by the service. First we need to start the dependencies of the example by running: ```bash -docker-compose -f examples/docker-compose.yml up -d +docker-compose -f docker-compose.yml up -d ``` Next we run the service: diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml deleted file mode 100644 index cd6c437cb0..0000000000 --- a/examples/docker-compose.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: '2.1' - -services: - rabbitmq: - image: docker.io/bitnami/rabbitmq:latest - ports: - - '4369:4369' - - '5551:5551' - - '5552:5552' - - '5672:5672' - - '25672:25672' - - '15672:15672' - environment: - - RABBITMQ_USERNAME=bitnami - - RABBITMQ_PASSWORD=bitnami - - RABBITMQ_SECURE_PASSWORD=yes - - RABBITMQ_MANAGEMENT_ALLOW_WEB_ACCESS=yes - volumes: - - 'rabbitmq_data:/bitnami/rabbitmq/mnesia' - zookeeper: - image: 'bitnami/zookeeper:latest' - ports: - - '2181:2181' - environment: - - ALLOW_ANONYMOUS_LOGIN=yes - kafka: - image: 'bitnami/kafka:2' - ports: - - '9092:9092' - - '9093:9093' - environment: - - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 - - ALLOW_PLAINTEXT_LISTENER=yes - - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT - - KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093 - - KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093 - - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT - depends_on: - - zookeeper - localstack: - image: localstack/localstack:latest - ports: - - "127.0.0.1:4566:4566" # LocalStack Gateway - - "127.0.0.1:4510-4559:4510-4559" # external services port range - environment: - - DEBUG=${DEBUG-} - - DOCKER_HOST=unix:///var/run/docker.sock - - AWS_ACCESS_KEY_ID=test - - AWS_SECRET_ACCESS_KEY=test - - AWS_DEFAULT_REGION=eu-west-1 - volumes: - - "${TMPDIR:-/tmp}/localstack:/var/lib/localstack" - - "/var/run/docker.sock:/var/run/docker.sock" -volumes: - rabbitmq_data: - driver: local diff --git a/examples/examples.go b/examples/examples.go index a09de3c163..7d7e215771 100644 --- a/examples/examples.go +++ b/examples/examples.go @@ -31,7 +31,7 @@ const ( KafkaTopic = "patron-topic" KafkaGroup = "patron-group" - KafkaBroker = "localhost:9093" + KafkaBroker = "localhost:9092" ) func CreateSQSAPI() (*sqs.Client, error) { From 2cb11671b606433be96e2157cc578fb7ce6bf0d9 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 10:48:20 +0200 Subject: [PATCH 09/18] Fix tests --- .github/workflows/go.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5bdc14eb1e..7385ad2190 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -36,6 +36,9 @@ jobs: - name: Check out source code uses: actions/checkout@v4 + - name: Unit tests + run: make test + - name: Start dependencies run: make deps-start From d3d68b8066d1c82930b5993ab0c320d3093a89df Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 11:40:59 +0200 Subject: [PATCH 10/18] Fix Tests --- .github/workflows/go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7385ad2190..edcfd3e66a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -8,7 +8,7 @@ on: jobs: lint: name: Lint and fmt check - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Check out source code uses: actions/checkout@v4 @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: "go.mod" - name: Linting and fmt check run: make lint @@ -26,7 +26,7 @@ jobs: strategy: matrix: go-image-version: ["1.21"] - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Set up Go ${{ matrix.go-image-version }} uses: actions/setup-go@v5 From 683aa404eae0fd1ecacd395a3f3b701aea466bf9 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 11:53:27 +0200 Subject: [PATCH 11/18] Fix tests --- .github/workflows/go.yml | 6 +++--- Makefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index edcfd3e66a..df5d951bec 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -42,9 +42,6 @@ jobs: - name: Start dependencies run: make deps-start - - name: Wait dependencies - run: sleep 60 - - name: Running CI run: make ci @@ -58,3 +55,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./coverage.lcov + + - name: Stop dependencies + run: make deps-stop \ No newline at end of file diff --git a/Makefile b/Makefile index c7d583d667..0b6ffb667a 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ cover: fmtcheck go tool cover -func=coverage.txt && \ rm coverage.txt -ci: deps-start +ci: go test ./... -race -cover -mod=vendor -coverprofile=coverage.txt -covermode=atomic -tags=integration && \ mv coverage.txt coverage.txt.tmp && \ cat coverage.txt.tmp | grep -v "/cmd/patron/" > coverage.txt From 554bdd41a7afd8c426f68374c5b6cf1dd7ff2c34 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 12:01:43 +0200 Subject: [PATCH 12/18] Fix tests --- .github/workflows/go.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index df5d951bec..bf9a6aaa24 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -43,7 +43,9 @@ jobs: run: make deps-start - name: Running CI - run: make ci + run: | + sleep 10 + make ci - name: Convert coverage file to lcov run: | From 02d7f845a04af4fe398541d0caf3099750f366fd Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 12:09:31 +0200 Subject: [PATCH 13/18] Fix tests --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bf9a6aaa24..554b2e36aa 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,7 +44,7 @@ jobs: - name: Running CI run: | - sleep 10 + sleep 30 make ci - name: Convert coverage file to lcov From ab461b7a32899a59594b23b46b747618cd39501d Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 13:25:41 +0200 Subject: [PATCH 14/18] Fix tests --- .github/workflows/go.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 554b2e36aa..3549189468 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,7 +44,7 @@ jobs: - name: Running CI run: | - sleep 30 + sleep 0 make ci - name: Convert coverage file to lcov @@ -57,6 +57,18 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./coverage.lcov - + + - name: e2e - Starting service + run: | + go build . + nohup ./service & + working-directory: ./examples/service + + - name: Starting client + run: | + go run main.go + working-directory: ./examples/client + - name: Stop dependencies - run: make deps-stop \ No newline at end of file + run: make deps-stop + \ No newline at end of file From af44e7709f1a927fac99508b4afd418cabd4e97d Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 13:32:27 +0200 Subject: [PATCH 15/18] Fix tests --- .github/workflows/{go.yml => ci.yml} | 6 +---- .github/workflows/e2e.yml | 37 ---------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) rename .github/workflows/{go.yml => ci.yml} (95%) delete mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/go.yml b/.github/workflows/ci.yml similarity index 95% rename from .github/workflows/go.yml rename to .github/workflows/ci.yml index 3549189468..5b36407450 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/ci.yml @@ -36,15 +36,12 @@ jobs: - name: Check out source code uses: actions/checkout@v4 - - name: Unit tests - run: make test - - name: Start dependencies run: make deps-start - name: Running CI run: | - sleep 0 + sleep 30 make ci - name: Convert coverage file to lcov @@ -71,4 +68,3 @@ jobs: - name: Stop dependencies run: make deps-stop - \ No newline at end of file diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index a0eda82dd6..0000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: E2E -# on: -# push: -# branches: -# - master -# pull_request: -jobs: - build: - name: E2E - runs-on: ubuntu-latest - steps: - - name: Check out source code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - - - name: Starting dependencies - run: | - docker-compose up -d - sleep 10 - working-directory: ./examples/ - - - name: Starting service - run: | - docker ps -a - go build . - nohup ./service & - working-directory: ./examples/service - - - name: Starting client - run: | - sleep 10 - go run main.go - working-directory: ./examples/client From 2afa3cdef3c94990783ec80339e6a921162324b3 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 13:42:47 +0200 Subject: [PATCH 16/18] Fix tests --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b36407450..e21ceca810 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,16 +55,12 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./coverage.lcov - - name: e2e - Starting service + - name: e2e run: | - go build . + go build -o ./service . nohup ./service & - working-directory: ./examples/service - - - name: Starting client - run: | - go run main.go - working-directory: ./examples/client + go run client/main.go + working-directory: ./examples - name: Stop dependencies run: make deps-stop From 373e6f1eab3f6b0a53db684b45b58b6717ae9381 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 13:43:54 +0200 Subject: [PATCH 17/18] Fix tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e21ceca810..dcebca23d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: - name: e2e run: | - go build -o ./service . + go build -o service ./service/ nohup ./service & go run client/main.go working-directory: ./examples From 6dccbc48bdd298559a901a36780ade3529ae8b05 Mon Sep 17 00:00:00 2001 From: Sotirios Mantziaris Date: Sun, 17 Mar 2024 14:37:08 +0200 Subject: [PATCH 18/18] Fix tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcebca23d1..aa09cba820 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: - name: e2e run: | go build -o service ./service/ - nohup ./service & + nohup ./service/service & go run client/main.go working-directory: ./examples