text
stringlengths
0
1.24k
**Johnny Boursiquot:** I'm interested in diving into this whole testing story as well, because normally I'd be thinking "Okay, I need to containerize all the things, maybe use Docker Compose to get all these services talking to each other... You start to basically add all these layers of complexity to your testing stor...
In your case, you're talking about "Okay, I have a frontend and I have a backend and I have a data store." Those are your three pieces that you care about. So what does your testing infrastructure look like? Are you running everything on a local host, are you packaging things, are you using Docker, are you containerizi...
**David Hernandez:** It's basically everything local. The Go binary, it serves also the static files in local. For the data store we're using Firestore; it's the database from Google Cloud Services. They ship an emulator, so in local, for testing, we can spin up the emulator, run whatever test, and tear the emulator do...
\[31:55\] At some point, at the beginning of the project, we put a continuous integration thing also in G Cloud, but we didn't use it at all. We were just doing it more in local than we tried to do it in continuous integration. Probably with two people you don't have the problem. If the thing grows more, we're probably...
**Mat Ryer:** You're right though, I think team size means lots of things are easier, actually. Some of the decisions we've taken I don't think you would necessarily take if you were in a larger team, or a bigger company with lots of teams. I think the situation, the structure that you're organization is in - I think t...
And I think yeah, if you had more and more people joining the team, you would have to then formalize those things a little bit. Same for code structure though... In that sort of world it might make sense to invest in that service abstraction and solve some of the common problems, and then everyone can benefit from that...
**Jon Calhoun:** Mm-hm. So you don't need a release manager, is that what you're saying? \[laughter\]
**Mat Ryer:** We don't need a release manager, yeah.
**David Hernandez:** We've had it before. It's not the case that we never had a release manager. We had it before, some time ago... But yeah, different sizes come with different problems; speed is different... That's why people try to put things like microservices; not because microservices are a better technology, but...
**Mat Ryer:** Yeah, I remember that release manager wanted to do two releases a month, and then be in sync with everyone... And they asked how many times we were releasing, and it was -- that day was something between 10 and 20, or something. It was a very different mindset of rapid -- as soon as it's a bit better than...
**Jon Calhoun:** So with that type of release cycle, would you carry that same mindset over to something like Oto?
**Mat Ryer:** That's a funny one, because the thing is, that Oto project hasn't really changed much since we've first put it out there.
**Jon Calhoun:** \[36:01\] Okay. So let's say you're just doing another open source thing that people were importing and depending on in some capacity... Do you think that's something where the overhead of getting new versions is higher, that it would make more sense to slow down the release cycles?
**Mat Ryer:** Yeah, probably. And I think you hit it on the head; I think the point is it's about the audience of that thing. Yeah, if it was an open source project and people were writing to specific versions of it, I think that does change things quite a lot.
You have different promises as well. David and I, we have a monorepo; so we have all of our code for the whole company is in one repository. Again, another thing culturally that sounds kind of shocking to some people. I know that Facebook do it, and I think Google even have this great, big monorepo, although I'm sure t...
Having a monorepo is nice, because we can make breaking changes ourselves. If we break the API, in the same commit or in the same pull request we can contain the fixes for the frontend... You know, we'll have all the generated code from the Oto definitions; so they get all re-generated, so they're all new... And you ba...
**Jon Calhoun:** I think it's also important to note that sometimes that simplicity becomes problematic at scale... And the story that comes to mind for me is when I was at Google they had a monorepo; and usually, when you'd submit code, it would only test your local -- things that your code affected is what would get ...
**Mat Ryer:** Yeah, at scale... I mean, that sounds like a nightmare. But I can't imagine that - you're working on something and you push some code and then it's like "Okay, please wait. Building Google Maps..." It's like "What...?!" \[laughter\]
**Jon Calhoun:** The way it worked was kind of... I don't remember the exact -- it's been so long... But all I remember is that it was roughly something where your dev process felt pretty quick, because it didn't wait on all that... But eventually, you kind of get feedback later asynchronously that's like "Oh, by the w...
So I think some people -- like, you guys said you weren't using continuous integration, but I think there are some companies that... I'm sure some listeners have been in a company where you deploy a fix, and running all the tests sometimes, especially integration tests, can take so long that it's really not worth sitti...
**Mat Ryer:** Yeah. Well, we're lucky, because we are sometimes quite irritable easily, so there's no way we would tolerate our tests being slow. We're quite reactionary sometimes, especially when there's emotional things. Sometimes that's what will drive our day; if there's something in the app -- because we dogfood t...
\[40:25\] The other thing is we have some integration tests to pepper throughout the code, but we certainly don't have 100% unit test code coverage, or anything like that... And that's because the code's all being tested through these integration tests. And really, they have to be quick, because that's the same API tha...
So in a way, yeah, it's nice that our testing uses the API, because we'll get that feedback from it; if there are things that are just taking too long, it's gonna be annoying us a lot more than annoying anyone else first, and we'll go and fix it.
**Johnny Boursiquot:** Did you not see value in having full end-to-end testing? So rather than having the layer that the frontend talks to, which is what you're using in your integration testing - was it too complicated to actually have the frontend drive the communication and seeing the whole thing front to back?
**Mat Ryer:** We did look at it... I'm still open to it, but the answer is yeah, it wasn't trivial, it wasn't easy to do, and so it didn't happen. The other thing is with UI testing there are bits that are kind of perfect, they make sense if you take a status and you're gonna turn that into a string or something, or yo...
So there's a lot of manual testing in the frontend anyway, but I'm definitely open to -- I've used some before, but not enough to be confident with... But there are tools, headless browsers and things that do a very good job of simulating what real users will be doing.
**Johnny Boursiquot:** Along those lines, what is the make-up of your typical functionality, from the time the frontend triggers it, to the number of things happening in the backend? Here's what I mean by that - for example, for a user to be able to accomplish a task, that task may require multiple steps. So from the t...
Now, the frontend is still tracking the state of the entire number of steps required to actually consider that one thing the user wants to do to be complete, right? So now the frontend makes another call to trigger the second part of the step, process it with the backend, and then a third, and a fourth, and whatever. O...
**David Hernandez:** \[44:02\] Interesting question. I'm not sure if I'm answering your question, but we try to imitate in the test what the user will do or click in the frontend. That means that it's gonna do one request, wait for the response, do another request. For example, every time that our test will start, our ...
When you need to do another functionality, you do those three things. You create a card, wait for the card that is created, assert that you have a card ID, and do their operations. That's basically how it's saved. It tries to imitate what you usually do in the frontend, but calling the API, the Go client to use the API...
**Mat Ryer:** Yeah, we don't have too much of what you describe, Johnny, where lots of different API calls have to happen for the UI to then be able to continue the story, or whatever. Because our API isn't a public API yet, it's kind of tightly bound to the frontend, so that means we'll put all the data we need for a ...
Hopefully, because of the data store choice, key information will be denormalized, so it's not gonna have to go and look around the data store to gather up the answer. Hopefully, it's just going to one place or a couple of places to get the information, and then stitches it together and returns it all in one go to the ...
And that's nice, because you can do things like -- you know, it has live updates in there. So we have an event that can happen where all the connected browsers will notice this event, and we do this when something changes in a team... And then all of those browsers can then go and ask for an update and get the latest t...
I think if we were building a public API, we probably would have maybe more fine-grained API endpoints, because they'd be more general purpose. Having said that, when I look through them, they are kind of all that already, just by chance, I think. There isn't much magic or complex stuff going on in the server. But when...
**David Hernandez:** Mat is trying to say that we are much better Go developers than JavaScript developers, probably... He doesn't recognize. I'm kind of the junior JavaScript developer, and Mat is junior++ maybe... \[laughter\]
**Jon Calhoun:** I'm not sure if you ever get out of that junior category in the JavaScript world... Not unless you dive in full-time.
**Mat Ryer:** yeah.
**Jon Calhoun:** So one of the listeners on Twitter had asked if you guys were using GraphQL, and I assume that that means you're not, because you don't really have a reason if you're returning everything you need already.
**Mat Ryer:** Yeah, I think that's right. GraphQL - one of the nice things is people get to describe the data they need from a data store, and that saves a lot of (I suppose) resources, and certainly bandwidth, and things like this... Although in practice I've never found it to be that useful - again, because I think i...
\[48:26\] I think we do have some handlers as well... We have a handler for the initial index page of the app, but I think in production, because of the way you describe the app, that becomes static content. So App Engine actually distributes that to CDNs, and it gets served properly, statically. So in production, the ...
**Jon Calhoun:** So you've mentioned your database being Firestore; I think that's what you said. And you've mentioned Pubsub for background tasks... So I wanna talk more about those, but can you give a quick overview of what your tech stack is? Because I don't think we've fully just walked over it, briefly...
**Mat Ryer:** Yeah. So we have Svelte in the frontend. Svelte is like Vue and React, in that you build these components; that's how you build the frontend - you import components, and you have events and properties, just like you do in the other ones. The nice thing about Svelte is it's a kind of compile-time build. So...
**David Hernandez:** I will say that Svelte is a little bit Go. We choose it because it reminds us -- it has a lot of Go in it, isn't it?
**Mat Ryer:** Yeah. Minimalist, it's deliberately cut down on the features, it doesn't try and do everything... But that means you can kind of learn the whole of Svelte quite quickly, and then that's everything you need to know then about a system. So there's big benefits in that too, because obviously the learning cur...
So Svelte - yeah. And that's running in the frontend. We do have a UIkit CSS framework as well, that we've then added our own CSS onto, and we use SCSS for the compile-time, so we can use variables, and things... That all gets then built into static folders. That's then described in our App Engine configuration file, a...
So you say "This folder is all just static, so serve it statically, but these endpoints are gonna hit our Go service", and there we have our Go server running on that port, waiting for those requests, and it just responds to the requests. It goes through that Oto thing, so the translation between JSON and back is done.
In our implementations we're dealing with strongly-typed generated code, so we can return errors, we have a response object that we can set the fields on and return it... It's very familiar and very easy code to write and to maintain.
\[52:10\] And then as the Pubsub thing inside App Engine - if you make a comment on something, we save that comment immediately, and then we reply and say "Okay, it's done. Carry on." So that makes the UI very snappy. But there's work to do after the fact. So if there's five people in this conversation, we're gonna go ...
**David Hernandez:** Yeah. Database with Firestore, and that's it. We don't have much. We've put some data to BigQuery, to just back up some -- to do some sort of analytics to see how many people are using it, basically... That's it. For now, it's just a pretty simple architecture.
**Break:** \[53:21\]