Live data from Hacker News

Air – Live reload when developing with Go

github.com

31–40 of 46 posts

Re: Air – Live reload when developing with Go

#31
post #30
post #26

Earlier quoted context omitted.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode? How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

I lnow you're saying that when it comes to GUIs you have to do it manually, but as someone working on the back-end this begs the question: is there no unit tests framework or anything for GUIs ?

Depends if we are talking about native or web based GUIs, and then the best you can get is automating the user clicking buttons and if the UI changes in some limited ways.

There is no way to properly test UI/UX experiences, even if the test is correct for a button being displayed with the right label, doesn't mean it looks correctly from user experience point of view, yet the test is green.

Re: Air – Live reload when developing with Go

#32
post #29
post #26

Earlier quoted context omitted.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode? How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

Given go's nature of being more network oriented, I think these questions are a bit disingenuous. Go comes with a lot of facilities for testing the things it's good at. If testing GLSL shaders, or gui applications is difficult, I'd consider putting at least some pressure on the tooling providers to provide better testing facilities. I'm more familiar with how opengl & shaders work than I am with text rendering - so I…

Ah the typical answer when TDD advocates get challenged at conferences regarding UI testing.

Advocacy works great when only data structures get tested.

Re: Air – Live reload when developing with Go

#33
The best tool I’ve found for this job is reflex[1]. It’s easy to setup, Go agnostic, very « UNIX » in its philosophy, doesn’t get in your way with its own logs, and just works.

Before that I used realize but it has the bad behavior of always adding it’s own prefix to the logs, which sucks.

[1]: https://github.com/cespare/reflex

Re: Air – Live reload when developing with Go

#34
post #26
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode? How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

Write a test that launches the application and checks relevant pixels, at the very worst. Which is not generally all that hard. Bonus points if you save the full image so you can see expected / actual results easily.

Re: Air – Live reload when developing with Go

#35
post #8

I built something like this in Go a few years ago but it reloads your infrastructure when it changes, recompiles your code when it needs to, and syncs static files or interpreted files to wherever your app is running (desktop or cloud). Think of it like docker-compose but with file watching + sync + smart rebuilds. https://skaffold.dev/

How does it handle watch mode for compiled or built code?

Re: Air – Live reload when developing with Go

#36
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

Does live-reload that runs tests exist?

If it can watch files and trigger your app to boot it can certainly trigfer the test runner.

Re: Air – Live reload when developing with Go

#37
post #8

I built something like this in Go a few years ago but it reloads your infrastructure when it changes, recompiles your code when it needs to, and syncs static files or interpreted files to wherever your app is running (desktop or cloud). Think of it like docker-compose but with file watching + sync + smart rebuilds. https://skaffold.dev/

One of my most used tools. Absolute joy to work with it and its Helm integration.

Re: Air – Live reload when developing with Go

#38
post #31
post #30

Earlier quoted context omitted.

I lnow you're saying that when it comes to GUIs you have to do it manually, but as someone working on the back-end this begs the question: is there no unit tests framework or anything for GUIs ?

Depends if we are talking about native or web based GUIs, and then the best you can get is automating the user clicking buttons and if the UI changes in some limited ways. There is no way to properly test UI/UX experiences, even if the test is correct for a button being displayed with the right label, doesn't mean it looks correctly from user experience point of view, yet the test is green.

I'm expecting someone to train a ML model soon to interpret and score GUIs.

"This page is confusing" and "This page no clear call to action" And "This page is ugly" And "This button doesn't look like a button."

Re: Air – Live reload when developing with Go

#39
post #31
post #30

Earlier quoted context omitted.

I lnow you're saying that when it comes to GUIs you have to do it manually, but as someone working on the back-end this begs the question: is there no unit tests framework or anything for GUIs ?

Depends if we are talking about native or web based GUIs, and then the best you can get is automating the user clicking buttons and if the UI changes in some limited ways. There is no way to properly test UI/UX experiences, even if the test is correct for a button being displayed with the right label, doesn't mean it looks correctly from user experience point of view, yet the test is green.

Taking repeated screenshots of a GUI and making sure they don't change across commits is a useful thing to have in CI a lot of the time to make sure if you did change something somebody's eyeballed it for correctness.

However I'm not at all claiming that removes the 'eyeballed it' step, just that it makes it harder to miss said step :)

Re: Air – Live reload when developing with Go

#40
post #30
post #26

Earlier quoted context omitted.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode? How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

I lnow you're saying that when it comes to GUIs you have to do it manually, but as someone working on the back-end this begs the question: is there no unit tests framework or anything for GUIs ?

For native Android apps there is a framework to do GUI tests. The test code stayed in your release as a NOOP last time i looked at it, may be fixed now.
Post reply on HN