rewrite-clj

https://github.com/clj-commons/rewrite-clj
lread 2021-03-31T15:54:41.110400Z

@mauricio.szabo I gave your instructions for repl-tooling a try. Cool! But interactive(?). Is there something I could run on CI that returns pass/fail?

mauricio.szabo 2021-03-31T16:46:00.110500Z

You mean that interactive is failing?

mauricio.szabo 2021-03-31T16:48:57.110700Z

Strange, interactive-test is passing for me. You can open the devtools console on Electron and see what's wrong (I believe its ctrl-`shift`-`i`) or try to restart the compiler and then reload the electron app

lread 2021-03-31T16:56:55.110900Z

Ha! Always room for confusion! By “interactive(?)” I meant can I run something non-interactive that would exit with 0 on success. I can see why you thought I was referring to interactive-test which frankly, I am not even aware of yet! :simple_smile: I only ran the commands you shared with me in chat:

npm install
./script/watch
npm start

mauricio.szabo 2021-03-31T17:31:13.111100Z

Right! So, one way is that after ./scripts/watch you run:

npx shadow-cljs clj-run repl-tooling.integration/run-tests-on-ci

mauricio.szabo 2021-03-31T17:31:23.111300Z

That's what I use to run on CircleCI

mauricio.szabo 2021-03-31T17:31:45.111500Z

Wait...

mauricio.szabo 2021-03-31T17:31:59.111700Z

You don't even need to run ./scripts/watch 😄

lread 2021-03-31T17:32:19.111900Z

Aha!

mauricio.szabo 2021-03-31T17:32:28.112100Z

You can just run:

npm install
npx shadow-cljs clj-run repl-tooling.integration/run-tests-on-ci

mauricio.szabo 2021-03-31T17:33:33.112300Z

This will fire up the watch process for shadow, start the "fixture app", run the tests, and will exit with code 0 if tests pass, or 1 if something fails. I believe it'll also retry tests that fail up to 5 times

mauricio.szabo 2021-03-31T17:34:27.112500Z

(It's just an etaoin code to scrap the tests from the Electron app, really 😄. So I believe you'll need Chromedriver - if you're on Linux, you can get it from here: https://chromedriver.storage.googleapis.com/76.0.3809.126/chromedriver_linux64.zip)

lread 2021-03-31T17:34:37.112700Z

cool, I’ll check repl-tooling for any pre-reqs needed.

lread 2021-03-31T17:37:43.112900Z

I dev on macOS but CI on Linux.

lread 2021-03-31T17:38:00.113100Z

I can do a brew install chromedriver so, maybe…

lread 2021-03-31T17:58:36.113300Z

Ah no the brew installed chromedriver mismatches. But there is https://www.npmjs.com/package/electron-chromedriver, but no exact match for electron 6.0.2, but maybe 6.0.0 will work? Yeah, I can launch your tests.

lread 2021-03-31T17:59:59.113700Z

But I’m getting failures…

lread 2021-03-31T18:00:15.113900Z

I’ll try on a linux VM first.

lread 2021-03-31T18:27:09.114100Z

Hmm.. I’m getting test failures on my linux VM as well. I shall probably put adding repl-tooling to rewrite-clj libs tests on on hold for now.

lread 2021-03-31T18:27:30.114300Z

Neat what you did with Electron there though!

mauricio.szabo 2021-03-31T21:21:48.114500Z

Thanks! The Electron version should not matter much, really. I'll try to see if there's something wrong on my side too

mauricio.szabo 2021-03-31T21:22:29.114900Z

(I'll start some features in the near future, so I'll re-visit these tests 😄)

lread 2021-03-31T21:58:10.116Z

https://github.com/greglook/cljstyle is has upgraded to rewrite-clj v1 as part of their current release. 🎉

🎉 3