unrepl

discussing specification of an edn-based repl and its implementations.
pesterhazy 2017-11-27T09:59:16.000332Z

@cgrand what's the issue with quoting? I feel I'm lacking some context

cgrand 2017-11-27T10:00:21.000462Z

my pain with quoting impl is due to a bad decoupling between print-on and ednize

cgrand 2017-11-27T10:01:16.000175Z

Quoting is about the fact that when I work on unrepl I do have #unrepl/xxx as data and donโ€™t want them handled by the client

cgrand 2017-11-27T10:05:16.000291Z

@pesterhazy you see what I mean?

pesterhazy 2017-11-27T10:06:18.000438Z

@cgrand, your edn printer needs to handle those "specials" in a special way?

cgrand 2017-11-27T10:06:46.000388Z

which printer, the unrepl one?

pesterhazy 2017-11-27T10:07:50.000165Z

yeah

pesterhazy 2017-11-27T10:08:02.000535Z

I'm trying to summarize to see if I understand

cgrand 2017-11-27T10:10:16.000243Z

Excert from unravel:

user=> [(tagged-literal โ€™unrepl/... nil)]
[#__1]

cgrand 2017-11-27T10:10:38.000117Z

I would expect [#unrepl/... nil]

cgrand 2017-11-27T10:11:01.000016Z

but itโ€™s a super niche issue affecting mostly me

pesterhazy 2017-11-27T10:11:17.000080Z

ah

pesterhazy 2017-11-27T10:12:00.000260Z

so the issue is you can't distinguish between "fake" unrepl defrecords (tagged literals) generated by client code and the genuine ones?

cgrand 2017-11-27T10:23:40.000441Z

yup

pesterhazy 2017-11-27T10:26:16.000038Z

that does seem like a niche issue ๐Ÿ™‚ def not a release blocker

volrath 2017-11-27T10:28:41.000365Z

@cgrand @pesterhazy question: do any of you have like a set of tests that you use to check border cases / printing /etc, when working on unravel? I have a file with a couple of things that I use to test everything is displaying correctly, but I'm sure there might be more interesting types of "tests"

volrath 2017-11-27T10:28:50.000265Z

this is what I have so far:

volrath 2017-11-27T10:28:55.000312Z

(+ 1 1)
{:a 1}

(def square #(* % %))
(square 5)

(list
 (range 100)
 (into [] (range 100))
 (into #{} (range 100)))


(def letters (map char (range 97 (+ 97 26))))
(zipmap letters (range 20))
(zipmap letters (repeatedly #(range 100)))

(apply str (repeat 100 "a"))
(print "hi")
(println "hi")
(print (apply str (repeat 100 "a")))
(println (apply str (repeat 100 "a")))


(/ 1 0)
x

(future
  (Thread/sleep 5000)
  (println "delayed 5 secs"))

volrath 2017-11-27T10:31:49.000472Z

(I'm also testing objects, like printing functions, atoms, etc)

pesterhazy 2017-11-27T10:58:36.000396Z

nice!

pesterhazy 2017-11-27T10:58:46.000221Z

@volrath there's scripts/tests

volrath 2017-11-27T10:59:43.000033Z

ah, perfect ๐Ÿ™‚

pesterhazy 2017-11-27T11:00:09.000299Z

it would be fantastic to add these as a further test case

volrath 2017-11-27T11:00:18.000230Z

maybe it'd be nice to have a collection of these expresions, so that we could use unrepl's output for them and test

volrath 2017-11-27T11:00:20.000374Z

haha yeah

pesterhazy 2017-11-27T11:00:35.000293Z

don't judge me for my homegrown "unit testing" framework

pesterhazy 2017-11-27T11:01:04.000522Z

more like end-to-end tests I guess

volrath 2017-11-27T11:01:24.000425Z

so I'm thinking maybe do a collection of this files with their corresponding unrepl edn outputs as edn files, and every client could use those edn files to reproduce entire repl sessions

pesterhazy 2017-11-27T11:01:56.000413Z

have you seen this? https://github.com/Unrepl/unravel/blob/master/test/basic.ought.regex

volrath 2017-11-27T11:02:05.000184Z

hey, if it works.. I wonder, how do you use those?

volrath 2017-11-27T11:02:20.000221Z

what command do you run to test the regex?

pesterhazy 2017-11-27T11:02:30.000099Z

scripts/tests

volrath 2017-11-27T11:02:39.000333Z

ok

pesterhazy 2017-11-27T11:03:18.000076Z

for each "FILE" it sends "FILE.clj" to the repl and expects "FILE.ought" or "FILE.ought.regex"

pesterhazy 2017-11-27T11:04:03.000094Z

well the list of files is currently hardcoded https://github.com/Unrepl/unravel/blob/master/scripts/test-runner#L45

pesterhazy 2017-11-27T11:04:12.000243Z

but that can be easily turned into a glob

volrath 2017-11-27T11:04:18.000470Z

right

pesterhazy 2017-11-27T11:04:56.000287Z

maybe EDN would be better but I just went with the simplest thing that worked

volrath 2017-11-27T11:05:01.000468Z

it's good

volrath 2017-11-27T11:05:15.000126Z

edn is easier to setup in something like travisci

volrath 2017-11-27T11:05:33.000365Z

I guess it's possible to run a repl in travis, but way slower

pesterhazy 2017-11-27T11:05:33.000439Z

you mean, get nicer test output? as in JUnit?

pesterhazy 2017-11-27T11:05:48.000019Z

this should work well on travis

pesterhazy 2017-11-27T11:06:18.000209Z

just haven't gotten around to set up CI

volrath 2017-11-27T11:07:23.000396Z

i mean just automating it.. I haven't run any clojure tests con travis, I'm guessing they have images for that.. so it'd be just running a socket repl on the container, upgrading and sending the files

volrath 2017-11-27T11:07:49.000411Z

i thought edn because then you don't have to do any of that, it's faster, but it's not end-to-end

volrath 2017-11-27T11:08:37.000277Z

but now that i think about it, it's better to run the repl in every test

volrath 2017-11-27T11:08:50.000025Z

because that way you could also test your own blob customization, if any

pesterhazy 2017-11-27T11:14:38.000034Z

the script already does some of this, like starting the clojure server in the bg: https://github.com/Unrepl/unravel/blob/master/scripts/tests#L6

pesterhazy 2017-11-27T11:15:16.000431Z

On circle, we only need to install yarn and download the clojure jar - then I think it should be good to go

volrath 2017-11-27T11:16:36.000075Z

๐Ÿ‘

pesterhazy 2017-11-27T11:33:57.000251Z

hmm. can't figure out how to add circleci through the github org

pesterhazy 2017-11-27T11:40:28.000203Z

figured it out ๐Ÿ™‚

cgrand 2017-11-27T12:07:59.000081Z

@pesterhazy parfix ready to merge; --flag parfix to try it

pesterhazy 2017-11-27T13:31:48.000320Z

@volrath circle ci now passes: https://circleci.com/gh/Unrepl/unravel/10

volrath 2017-11-27T13:32:38.000066Z

cool, I'll probably do something similar for unrepl.el soon