-
-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
lein do uberjar, native
Hey @jeroenvandijk this looks really awesome and kudos to the effort! |
script/test
Outdated
(if (and (System/getenv "AWS_ACCESS_KEY_ID") (System/getenv "AWS_SECRET_ACCESS_KEY")) | ||
(println (aws/invoke s3 {:op :ListBuckets})) | ||
(println "No credentials")) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use an actual deftest like this to have better feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you mean the use this for a proper unit test, right? I didn't think the unit test setup through yet. Should I look at one of the other pods for an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and i think they are kinda simple and if you have better ideas for tests for the AWS ones that would be even more awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool, thanks! I'll have a better look tomorrow. Getting late here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeroenvandijk Here is an example bb script with tests included:
https://github.com/babashka/pod-babashka-sqlite3/blob/main/test/script.clj
This can be hooked up in CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've added tests now
(defn ops [client] | ||
(aws/ops (get-client client))) | ||
|
||
(defn doc [client op] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be surrounded by the with-out-str shim i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can reply it as a map containing the out
key like this That should handle it correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've captured the out value one level above 648a8c1 It's pretty close to the implementation of with-out-str
Now with tests. I also added some missing namespaces. Everything seems to be working. Note that I haven't put it through serious AWS usage yet, but I believe it's a proper start. Open items:
|
Oh and in addition I'm still thinking about how to integrate the credential interface for custom setups. But it's already usable without this addition through AWS environment vars.
|
I've added a first implementation. A few notes:
except for. Seeaws/doc
, see belowscript/test
for a working examplescript/compile
so I used the setup from graalvm-clojure.lein native-config
. I only added three lines therecredential_process
, something that is supported by other AWS tools, but this requires the implementation of a custom credential provider. This interface is not yet accessible outside of the pod. (some background here)