alexharsanyi
2020-7-9 08:17:12

Does anyone know if the tests in the plot-test package are run by the builds that produce the Racket snapshot releases? Or any other build? Most of these tests are “manual”, i.e. one has to run the code in the file, produce a plot and look at the plot, but some of the tests are automated.


samth
2020-7-9 11:03:27

samth
2020-7-9 11:04:59

samth
2020-7-9 11:09:05
  1. You can arrange to get email about failures on DrDr by having your email address appear in the responsible field of info.rkt, as described here: https://docs.racket-lang.org/raco/test.html?q=test-respon#%28part._test-config%29

alexharsanyi
2020-7-9 12:09:26

Thanks for the clarifications. Most of the tests however will create plots, but there is no verification for correctness, i.e. all the tests do is check that there are no exceptions raised while running the tests, but if the plot command suddenly starts producing empty plots, this would not be picked up.


alexharsanyi
2020-7-9 12:10:08

also, there is a compile-omit-paths key in the info.rkt file which means that none of the test files are built when the plot-tests package is installed.


samth
2020-7-9 12:13:03

Right (although no exceptions as a test does catch a lot of failures).


alexharsanyi
2020-7-9 12:15:27

But we can do more :slightly_smiling_face:


alexharsanyi
2020-7-9 12:17:21

with regards to setting myself as the responsible party for a test, what exactly is the “key”. I.e. how does drdr determine from a key such as “samth”, “robby” or “mflatt” what the email address is? Put it differently, what should I put in that field to get emails myself?


samth
2020-7-9 12:20:14

Right. Note that just adding files to plot-test (or anywhere else in the collection) will cause them to be automatically run by DrDr.


samth
2020-7-9 12:21:46

You should put your email address there. Names without domains go to @racket-lang.org addresses (which you can have if you want but doesn’t seem that useful).


alexharsanyi
2020-7-9 12:24:01

ok, so an email address is a valid value, I’ll do that.


samth
2020-7-9 12:25:00

The about page on DrDr is also a useful guide, although I don’t remember if it discusses this exact issue.


alexharsanyi
2020-7-9 12:25:57

with regards to tests, I was thinking of adding validation for the draw commands themselves, which would allow picking up changes in rendering. You can see the work in progress here: https://github.com/racket/plot/pull/61


alexharsanyi
2020-7-9 12:26:52

the problem is that they are machine specific, so I’ll need to think about that


alexharsanyi
2020-7-9 12:27:24

if these tests will run on multiple platforms


samth
2020-7-9 12:28:06

One option that’s used for redex is comparing with reference images. I think that is just run on specific platforms for which the images are created.


samth
2020-7-9 12:29:12

Another option would be to serialize in some other way (to SVG or PDF)


alexharsanyi
2020-7-9 12:29:34

the way I have done it was to use a record-dc% and compare the draw commands themselves


alexharsanyi
2020-7-9 12:29:59

this way, with some skill, one can identify which part is actually different


samth
2020-7-9 12:30:14

That’s a nice approach


alexharsanyi
2020-7-9 12:30:33

problem is that different machine have different fonts, so ticks and labels are drawn in slightly different positions


samth
2020-7-9 12:31:20

Yeah, fonts are tricky. That’s definitely an issue for the redex tests too.


alexharsanyi
2020-7-9 12:36:49

In any case, I just wanted to understand how and where the package is built, to know where to look in case I break something. Also, given that 7.8 will be released soon, I won’t make any changes until after that release. Thanks for pointing me to drdr.


samth
2020-7-9 12:38:07

I believe that changes now won’t appear in the release (unless you merge them to the release branch in plot) so you don’t need to worry at the moment


alexharsanyi
2020-7-9 12:40:45

Yes, I meant merging them to the plot master branch — I


alexharsanyi
2020-7-9 12:40:56

I will keep experimenting on my own separate branch


samth
2020-7-9 13:58:02

Sorry, I guess I was unclear. John Clements’ message from July 1 lists the 7th as “branch day”. After that point, release candidates and the eventual 7.8 release are built from the release branch of all the relevant repositories (including plot), or from the commit that was HEAD on that day if there’s no release branch. So if you commit something to master today, it won’t appear in 7.8 unless you also create a branch named release and cherry-pick that commit onto the release branch.


samth
2020-7-9 13:59:16

Also in that message he lists the 15th as when testing begins — at that point, before merging something to the release branch you should discuss with John.


spdegabrielle
2020-7-9 14:14:40

#quickscript-competition week two

Prizes: In addition to the glory and admiration of your peers… If you participate once, you get stickers, if you participate twice time, you get also a mug, if you participate three times, you get also a t-shirt (while stocks last) You can participate more than once per week. 

Thank you to the participants in week 1:https://github.com/Quickscript-Competiton/July2020entries/issues/4\|Breakout by Jens Axel Søgaard : The classic Breakout game in a single script! • https://github.com/Quickscript-Competiton/July2020entries/issues/3\|Format-selection by Alex Harsányi : Format comments to the Racket Style Guide standard. • https://github.com/Quickscript-Competiton/July2020entries/issues/2\|Robo-Head-Pat by https://github.com/Quickscript-Competiton/July2020entries/issues?q=is%3Aissue+is%3Aopen+author%3ALambduli\|Lambduli : It is like a good work sticker on your homework - but for code. • <https://github.com/Quickscript-Competiton/July2020entries/issues/1|Rot13 Decode/Encode> by Karrq : Fraq naq qrpbqr frperg zrffntrf yvxr Wnzrf Obaq! Don’t forget to check them out!

PSA: You don’t need to install Quickscript - it is bundled in DrRacket!

*Week 2…*starts with a bang with two awesome entries by Laurent Orseau: • <https://github.com/Quickscript-Competiton/July2020entries/issues/6|Letterfall: See you code fall like rocks!> • <https://github.com/Quickscript-Competiton/July2020entries/issues/5|Run this quickscript to install all scripts from the competition!> Looking for ideas? • make a Code-Prettify script that uses https://www.cs.utah.edu/plt/snapshots/current/doc/reference/pretty-print.html?q=pretty#%28def._%28%28lib._racket%2Fpretty..rkt%29._pretty-print%29%29\|pretty-print and reindent to prettify code. More at https://github.com/Quickscript-Competiton/July2020entries/blob/master/IDEAS.md

Enjoy! Stephen


samdphillips
2020-7-9 16:33:56

Re: comparisons of plot output, could there be a testing record-dc% that worked consistently across platforms for test purposes?


samth
2020-7-9 17:42:31

I think that’s hard because if you measure something and then use it to place something else the output still wouldn’t be consistent, I think, unless you ensured you had the same fonts and other platform behavior.


samdphillips
2020-7-9 19:26:48

I was thinking faking out the font metrics. Essentially mock out all of the drawing bits. It may be more trouble than it’s worth though.


samth
2020-7-9 19:27:55

I think that would be cool but also hard.


samdphillips
2020-7-9 19:31:02

Yeah estimating project complexity is one of my weak points…


soegaard2
2020-7-9 20:41:27

It seems the picture is wrong?



laurent.orseau
2020-7-9 20:46:03

why? The last line say a+d < h, as in the picture, no?


soegaard2
2020-7-9 20:47:24

You are right. I saw the pict. Read the next sentence and compared and a+d=h didn’t hold. Didn’t read further …


soegaard2
2020-7-9 21:36:41

Finally realized, why cropping a chess piece didn’t work. The font has the wrong descent.


notjack
2020-7-9 21:45:53

is that your own thing or the chess package?


soegaard2
2020-7-9 21:46:21

My own thing. I am attempting to draw a chess board.


soegaard2
2020-7-9 21:46:41

Thought it would be easy, but the unicode chess characters doesn’t have a mask.


soegaard2
2020-7-9 21:47:54

soegaard2
2020-7-9 21:48:17

The problem is drawing a hatched field below the piece.


soegaard2
2020-7-9 21:48:54

The unicode characters are transparent. So just drawing the character on top of a hatched field doesn’t work.


soegaard2
2020-7-9 21:50:24

I can get the text-outline as a series of curves. This works reasonably well to make a mask. But … getting the mask and the piece to line up afterwards is tricky.


notjack
2020-7-9 21:52:18

at that point I think just using svg drawings of the pieces would be a better way to go than fonts


soegaard2
2020-7-9 21:56:33

That’s a good backup plan (if I can find drawings with masks). I was hoping to make some general - so it also works with other board games.


alexharsanyi
2020-7-9 23:05:25

there are actualy ways to deal with the font problem, I just didn’t have time to experiment with a solution yet


cris2000.espinoza677
2020-7-10 00:40:31

in the eval-test files is where i tried to use them. they were on the same folder as the language.


cris2000.espinoza677
2020-7-10 00:43:15

how do i make queries in xexp? i used html-parsing to parse a page, but i need to get certain elements by id like with css selectors, but the xpath thingie is for absolute paths, sxml-match recommended https://docs.racket-lang.org/sxml-intro/index.html\|here under tools doesn’t exist anymore, or rather it says is still in PlaneT


massung
2020-7-10 00:46:12

you’d use the id attribute of xpaths. something like (it’s been a while): //tag[@id="id"]


cris2000.espinoza677
2020-7-10 00:48:16

but does it search recursively in the children?


cris2000.espinoza677
2020-7-10 00:49:22

weird… it works… question what does the double slash do?


cris2000.espinoza677
2020-7-10 00:49:42

is it like a wildcard?


cris2000.espinoza677
2020-7-10 00:51:18

ok, im dumb, when it didnt seem to work the first couple of times i just thought it didnt work like that


cris2000.espinoza677
2020-7-10 00:51:49

@massung thank you, you made me realize how it actually works


massung
2020-7-10 00:57:00

massung
2020-7-10 00:57:03

a great site :slightly_smiling_face:


massung
2020-7-10 00:57:12

glad it’s working for you now


cris2000.espinoza677
2020-7-10 04:45:14

thank you, it’s very handy