Skip to content
Merged
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
22 changes: 6 additions & 16 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,23 @@ jobs:
buid-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7

- name: docker compose up
run: make docker-up

- uses: actions/setup-java@v3
- uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version: '11'
java-version: '25'
java-package: jdk
architecture: x64

- uses: DeLaGuardo/setup-clojure@master
with:
cli: latest

- uses: 0918nobita/setup-cljstyle@v0.5.4
with:
cljstyle-version: '0.15.0'

- uses: DeLaGuardo/setup-clj-kondo@master
with:
version: '2023.02.17'
cljstyle: '0.17.642'
clj-kondo: '2026.08.04'

- name: Show versions
run: |
Expand All @@ -43,7 +37,7 @@ jobs:
clj-kondo --version

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ~/.m2
key: clj-cache-${{ hashFiles('**/deps.edn') }}
Expand All @@ -54,8 +48,4 @@ jobs:
run: make lint

- name: Test
env:
AWS_REGION: ap-northeast-1
AWS_ACCESS_KEY_ID: dummy
AWS_SECRET_ACCESS_KEY: dummy
run: make test
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7
with:
fetch-depth: 0

- uses: actions/setup-java@v3
- uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version: '11'
java-version: '25'
java-package: jdk
architecture: x64

Expand All @@ -28,7 +28,7 @@ jobs:
clojure --version

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ~/.m2
key: clj-cache-${{ hashFiles('**/deps.edn') }}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
### Changed
* Bump library versions.

## 0.6.130
### Breaking Changes
Expand Down
20 changes: 10 additions & 10 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/core.async {:mvn/version "1.6.673"}
org.clojure/tools.logging {:mvn/version "1.2.4"}}
:deps {org.clojure/clojure {:mvn/version "1.12.6"}
org.clojure/core.async {:mvn/version "1.9.865"}
org.clojure/tools.logging {:mvn/version "1.3.1"}}

:aliases
{:dev {:extra-paths ["test" "dev-resources"]
:extra-deps {com.cognitect.aws/api {:mvn/version "0.8.652"}
com.cognitect.aws/endpoints {:mvn/version "1.1.12.415"}
com.cognitect.aws/sqs {:mvn/version "822.2.1109.0"}
:extra-deps {com.cognitect.aws/api {:mvn/version "0.8.847"}
com.cognitect.aws/endpoints {:mvn/version "871.2.54.18"}
com.cognitect.aws/sqs {:mvn/version "871.2.34.1"}
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
software.amazon.awssdk/sqs {:mvn/version "2.25.65"}
software.amazon.awssdk/sqs {:mvn/version "2.55.0"}
aero/aero {:mvn/version "1.1.6"}
spootnik/unilog {:mvn/version "0.7.31"}
lambdaisland/kaocha {:mvn/version "1.80.1274"}}}
spootnik/unilog {:mvn/version "0.7.32"}
lambdaisland/kaocha {:mvn/version "1.91.1392"}}}

:test {:main-opts ["-m" "kaocha.runner"]}

:outdated {:deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}
:main-opts ["-m" "antq.core"]}

:build {:deps {com.github.liquidz/build.edn {:mvn/version "0.11.257"}}
:build {:deps {com.github.liquidz/build.edn {:mvn/version "0.11.266"}}
:ns-default build-edn.main}}}
3 changes: 1 addition & 2 deletions dev-resources/test-config.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{:region #keyword #or [#env AWS_REGION "ap-northeast-2"]
:queue-name #or [#env FIFO_QUEUE_NAME "local-queue.fifo"]
{:queue-name #or [#env FIFO_QUEUE_NAME "local-queue.fifo"]
:endpoint #profile {:dev {:protocol :http
:hostname "localhost"
:port 9324
Expand Down
8 changes: 3 additions & 5 deletions src/gluttony/record/cognitect_sqs_client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
[camel-snake-kebab.extras :as cske]
[clojure.core.async :as a]
[cognitect.aws.client.api :as aws]
[gluttony.protocols :as p])
(:import
(cognitect.aws.client.impl

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ns is deleted

Client)))
[cognitect.aws.client.protocol :as cognitect.protocol]
[gluttony.protocols :as p]))

(defn- invoke-async
[client op-map]
Expand Down Expand Up @@ -53,7 +51,7 @@
([]
(make-client nil))
([api-client]
{:pre [(or (instance? Client api-client)
{:pre [(or (satisfies? cognitect.protocol/Client api-client)
(nil? api-client))]}
(->CognitectSQSClient (or api-client
(aws/client {:api :sqs}))
Expand Down
2 changes: 1 addition & 1 deletion test/gluttony/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(software.amazon.awssdk.services.sqs.model
Message)))

(use-fixtures :each th/read-config-fixture th/test-client-fixture)
(use-fixtures :each th/test-client-fixture)

(use-fixtures :once th/start-logging-fixture)

Expand Down
44 changes: 25 additions & 19 deletions test/gluttony/test_helper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
[clojure.core.async :as a]
[clojure.java.io :as io]
[cognitect.aws.client.api :as aws]
[cognitect.aws.credentials :as credentials]
[gluttony.record.aws-sqs-client :as aws-client]
[gluttony.record.cognitect-sqs-client :as cognitect-client]
[unilog.config :as unilog])
(:import
(java.net
URI)
(software.amazon.awssdk.auth.credentials
AwsBasicCredentials
StaticCredentialsProvider)
(software.amazon.awssdk.regions
Region)
(software.amazon.awssdk.services.sqs
Expand All @@ -21,34 +25,36 @@

(def aws-client nil)

(defn read-config-fixture [f]
(alter-var-root #'config
(constantly (some-> (io/resource "test-config.edn")
(aero/read-config {:profile :dev}))))
(f))

(defn- create-cognitect-client
[]
(let [{:keys [region endpoint]} config]
(cond-> {:api :sqs}
region (assoc :region region)
(let [{:keys [endpoint]} config]
(cond-> {:api :sqs
:region :us-east-1
:credentials-provider (credentials/basic-credentials-provider {:access-key-id "test"
:secret-access-key "test"})}
endpoint (assoc :endpoint-override endpoint)
true (aws/client))))

(defn- create-aws-client
[]
(let [{:keys [region endpoint]} config]
(cond-> (SqsAsyncClient/builder)
region (.region (Region/of (name region)))
endpoint (.endpointOverride (URI/create (str (name (:protocol endpoint))
"://"
(:hostname endpoint)
":"
(:port endpoint)
(:path endpoint))))
true (.build))))
(let [{:keys [endpoint]} config
cp (StaticCredentialsProvider/create
(AwsBasicCredentials/create "test" "test"))]
(-> (SqsAsyncClient/builder)
(.region Region/US_EAST_1)
(.credentialsProvider cp)
(.endpointOverride (URI/create (str (name (:protocol endpoint))
"://"
(:hostname endpoint)
":"
(:port endpoint)
(:path endpoint))))
(.build))))
Comment on lines +43 to +52

(defn test-client-fixture [f]
(alter-var-root #'config
(constantly (some-> (io/resource "test-config.edn")
(aero/read-config {:profile :dev}))))
(let [cognitect-client (create-cognitect-client)
aws-client (create-aws-client)]
(alter-var-root #'client
Expand Down
Loading