There is a hidden gem in this video. Pause at 0:10, and you'll see the command:
npx sled-test-runner
What the heck is this?
To allow our developers to do their best work, we removed the hoops they would usually need to jump through to get their code into production.
Obviously (well, at least in retrospect), we needed to cut out QA. Dev servers are also out.
Wix decided to trust its developers to push code to production directly from their local dev machines.
Are we crazy? Yes. But not in that way.
How can we cut out these parts without compromising on the robustness of our production apps? How can we allow vast amounts of developers on different continents to push code to interdependent apps without breaking or stuff or negatively impacting performance?
Hundreds of millions of people rely on our online services to run their businesses!
Obviously, we will need some serious testing, but with each developer doing their own deployments, this means thousands of deployments per day, with each one triggering thousands of tests!
This means MILLIONS of unique test executions PER WEEK!
How can we possibly handle this? How long will developers have to wait for all these test results? We can't make them wait an hour every time they merge into the master branch, just to find out if their code passed inspection!
Luckily we found a way to do all of this in just about the same amount of time it takes to run a single test on your local machine!
Meet Sled.
SLED is our end-to-end testing platform.
Leveraging cloud computing to run all project test files in parallel, Sled allows us to run end-to-end browser tests against production without sacrificing speed.
We even run each test multiple times in parallel with itself so that we don't need to spend time rerunning flaky tests!
SLED uses open source technologies such as Chromium, Jest, and Puppeteer to orchestrate the parallel run of hundreds of concurrent tests using AWS Lambda as the underlying compute.
In addition, SLED is integrated into developers’ machines to deliver a completely seamless developer experience that responds as if the test was executed locally.
Developers at Wix can invoke upwards of a thousand different browsers, running a thousand different tests, and get the results from their laptops in two or three minutes!
Interested in learning more? Check out this video that outlines the architecture we use!
Wanna try it out? It sounds complicated, but it's actually not that hard to implement!
In this talk, Tom explains how this solution works and how you can adapt its core components to make it work for your project.
Tom will walk you step-by-step through an open-source project on Github that you can clone, experiment with, and even adapt to your own needs.
Top comments (0)