testing

genekim 2022-10-24T16:47:45.392139Z

Realizing this is actually a question about deps, I’m still posting here. I recently discovered on an airplane without WiFi access that this in my deps.edn file prevented me from running tests because of: io.github.cognitect-labs/test-runner {:git/tag "v0.5.0" :git/sha "48c3c67"} Is there a way to get :git deps to be cached to .m2 directory, or something, to enable running offline? Thank you!

genekim 2022-10-28T15:01:42.023949Z

80% probable yes — it’s close to manuscript deadline, so thus the 20% risk of not being able to attend. Very much looking forward to meeting you, if not there, sometime soon!

seancorfield 2022-10-24T17:34:23.449729Z

Git deps are cached to ~/.gitlibs but I think t.d.a still has to check the tag/short-SHA match. I think if you just use the full SHA and no tag it might not check? (but Alex would be able to confirm)

genekim 2022-10-24T17:47:44.115859Z

Thank you, @seancorfield — I would love to know how to do this. @alexmiller, is such a thing possible? Thank you!! (And sorry to bug!!)

genekim 2022-10-24T17:48:10.543559Z

I’ll ask in the #clojure channel, since he’s not in here. (Is that right channel?)

seancorfield 2022-10-24T17:48:28.204999Z

Look at the repo on GH for the tag/sha and click on the sha to see the full SHA in the URL...

seancorfield 2022-10-24T17:49:38.151659Z

Then remove :git/tag and update :git/sha with the full SHA.

seancorfield 2022-10-24T17:50:05.379879Z

I'm not saying that will prevent the online check, but I think it might...

seancorfield 2022-10-24T17:51:11.186769Z

Here's a thread in #clojure where Alex suggested that: https://clojurians.slack.com/archives/C03S1KBA2/p1663253553125709

genekim 2022-10-24T17:52:37.655369Z

“:git/tag” ?!? I didn’t even see that (just copied and pasted), and actually didn’t even know that existed — okay, I’ll try it out and report! Thx again!

seancorfield 2022-10-24T17:53:42.257409Z

So you'll go from {:git/tag "v0.5.0" :git/sha "48c3c67"} (what you showed) to {:git/sha "48c3c67f98362ba1e20526db4eeb6996209c050a"}

seancorfield 2022-10-24T17:54:47.400729Z

https://www.clojure.org/news/2018/01/05/git-deps -- :sha (now :git/sha) used to be the full SHA until :git/tag was added.

seancorfield 2022-10-24T17:55:28.396929Z

See https://clojure.org/reference/deps_and_cli#_git for current docs/deets.

genekim 2022-10-24T17:55:51.404759Z

OMG, @seancorfield — thanks for your help, but I didn’t intend to make my problems yours!!! 😱😱😂😂 sorry to intrude upon your day!!!

seancorfield 2022-10-24T17:56:13.278869Z

LOL! Happy to help!

genekim 2022-10-24T17:57:00.661559Z

You are amazing. Will report back in next day! (Amazing how motivated I am — i made sure test runner was running before I got onto plane!! 😂

seancorfield 2022-10-24T17:57:43.257139Z

Safe travels! Hope you're going somewhere fun?

genekim 2022-10-24T17:59:09.947089Z

Was in Las Vegas last week, did three DevOps Enterprise Summit — with amazing help of tools created from @plexus and team!!

genekim 2022-10-24T17:59:29.963779Z

No more planes for a couple of weeks, if all goes well!!!

👍🏻 1
🙏 1
genekim 2022-10-28T03:59:27.031189Z

@seancorfield Thank you — it worked, as per your instructions here: https://clojurians.slack.com/archives/C08LK2DH7/p1666634022257409?thread_ts=1666630065.392139&cid=C08LK2DH7 Just curious: do you think it’s worth suggesting changing the docs to recommend using :git/sha, or caveat on using :git/tag? Not sure how to log this somewhere, so the next person will know how to solve this problem… Thx again!! (And I’m also watching the LA Clojure Meetup meetup with you and Nate, describing Polylith. I’m 25% thru, and it’s great!!!)

seancorfield 2022-10-28T04:02:14.373709Z

If you use :git/tag and :git/sha together, you get verification that the tag and the commit actually match and it's much easier to see which version you're using (via the tag) and you only have to use the short (7-character) SHA. If you use :git/sha on its own, you have to use the full SHA and it's kind of meaningless in your deps.edn file.

seancorfield 2022-10-28T04:03:08.711069Z

So I use tag+sha when I'm depending on an officially released version and the full SHA when I'm depending on a fork or pull request (or a gist! did you know you can depend on a gist?? 🙂 )

seancorfield 2022-10-28T04:04:00.957819Z

See https://gist.github.com/seancorfield/6e8dd10799e9cc7527da5510c739e52f for an example of a Clojure-library-as-a-Gist!

seancorfield 2022-10-28T04:06:04.729139Z

Re: LA Meetup -- you'll get to see some World Singles code and our repo structure (and my VS Code setup). But it was recorded ages ago and we're up to 108 components now 🙂

genekim 2022-10-28T04:09:56.147489Z

HOLY COW!! What incredible timing! There’s now three or so .clj files I’ve been thinking of splitting out into a library, and just today, I was pondering whether I could just put it into a gist. I kid you not. Thanks again! (One is a bunch of JS code that I use over and over again in front end, and one is all the time related calls I use, converting possible time format to inst and back again.) Looking forward to buying you drinks sometime, Sean!!

genekim 2022-10-28T04:10:22.604799Z

Super looking forward to watching the rest of the video. Polylith is fascinating. I’ll move this conversation to the right channel. 🙂

seancorfield 2022-10-28T04:39:41.772519Z

Will you be at Conj in April?