EXTREMELY FAST & SIMPLE CI TESTING - SemaphoreCI
Skills:
CI/CD Pipelines90%
Key Takeaways
Sets up continuous testing for a Node.js project using SemaphoreCI
Full Transcript
in this video we are going to set up continuous testing for a node.js project using SEMA 4ci now sema4 is one of my favorite continuous testing platforms of all time because they really excel at speed which is one of my number one concerns when it comes to continuous testing I want it to test fast and from the moment you push code to GitHub to the moment your tests run and complete in my experience semi 4ci is by far the fastest continuous integration platform out there so here's my project it's the simple react Plus mobx app that I've been using for my last two videos and I've since added some tests to it that I can now run using the just command and the tests run and pass so if I run just here then there's my three test Suites they run and they pass now if you want to see what I did to get the test up and running you can look at the source code or even better I wrote an article on it on some Force Community tutorials uh and so it basically covers everything I did and why so those are up and running the only thing I want want to do at this point is I want to add that just command to my npm test script so when I run npm test it also runs just there this isn't something you have to do but it does make your life ever so slightly easier so this is pushed to GitHub and now I just want to get this thing continuously testing so when I create a pull request it adds those pretty little badges that testing is underway and testing is complete and whenever I make changes to master or any branch it's going to test those so let's go over to semi for C I have a brand new account here and I'm going to go ahead and add a new project then I'm going to pick my account and I'm going to connect it to GitHub this is an extremely simple process you can choose public or private since this is a public project I'm just going to do public I'm never going to test private projects here and I've gone ahead and I've authorized that application so now I can go back to my account and I can see all my GitHub projects so I can see this sem test semafor test there we go Sam test and I can start building off the master Branch let's go ahead do that and it's going to kind of analyze my project and determine hey this is a no. JS project let's kind of pull in some San defaults for you and get things started so I should have that here in just a moment okay there we go language is Javascript hey you're right on that let's go ahead pick my node.js version I'm using the latest and then is the setup npm install yes it is is the job npm test yep that's my job I could change that to just but I'll leave it npm test just in case I switch to mocha later on one day um let's go ahead and build with these settings so there we go and it's starting my build now for context if I were to run npm install on my local MacBook Pro uh npm install and then run npm test with this project it takes about 45 seconds so let's see what semaphore does okay check that out I skipped ahead and 1 minute on the dot which if you've used continuous testing before one minute is really fast for it to set up a testing environment uh with no JS install the correct version do an npm install and run the test if it takes me 45 seconds on my machine to run that a minute is really really fast but prepare to have your mind blown because it actually gets better let's go ahead and change our repo and see this thing retest I'm going to go ahead and get this badge here for my read me that seems nice let's go ahead and add that so I now have this cool build status and let's add our read me and push that so and push is complete let's go back to S test oh it already noticed it and queed it and it already started running the build so that was pretty much instantaneous which is really nice and let's see how long it takes to build this time around I'll give you a hint it's a lot faster there you go 16 seconds I cut a couple seconds of blank space out there for you but most likely due to npm caching that they've done on their side this thing created an environment for my test to run it did npm install it ran the test in 16 seconds which is just incredibly fast continuous integration incredibly fast test cases Happening Now obviously my tests happen really fast I'm doing them in node.js noj JS is blazing fast for unit tests and even functional tests so I've got my act together with my project and semor has their act together it's a great combination tests are just flying through before we wrap things up let's go ahead and check out a pull request let's go back over to my repo you see there we are build status passed awesome let's go and make a new branch and pull request that uh new branch and let's go ahead and make some kind of change to something let's say I'll just change the read me again test we'll do the same thing get out read me we'll commit that and we'll get push so that's going up there there's my new Branch let's go ahead pull request this let's go create that pull request and we can see that semafor is now testing that okay semafor CI is running the build and we're going to get to see how long it takes for that to show up again to the poll request and it's going to happen really fast so there we go I cut out 8 seconds and the tests have passed so again 15 seconds later I can see that this pull request is good to go let's go ahead and merge it confirm that merge and we are done I can go back to master you can see that it says it's pending because it's running tests against the master Branch now and if I were to refresh then I will see this to be passed here any second there we are my tests have passed on Master again so I can see that the pr worked fine and master obviously worked fine so there you have it that is semi 4ci and an extremely fast nutshell it is a great platform and just darn fast um and a huge thanks to sem4 C I reached out and told them I'd be doing a video and they were willing to sponsor this as well which I was going to bring you guys this content regardless cuz I think they're a great platform but huge shout out of thanks uh to SEI for being willing to sponsor it as well hope this helped you out and have an excellent day
Original Description
SemaphoreCI is a great testing platform primarily because it's blazing fast. In just a few seconds, we'll get continuous testing up and running for our Javascript Project!
SEMAPHORECI: https://semaphoreci.com/
THE CODE:
https://github.com/willrstern/semtest
THE BLOG POST:
https://semaphoreci.com/community/tutorials/how-to-test-react-and-mobx-with-jest
The #1 thing that I care about with continuous testing is SPEED. I want my tests to start running immediately and be completed very quickly. Enter SemaphoreCI. I'm not entirely sure how they do it, but they run and complete tests incredibly quickly.
For this sample javascript app with React and MobX with Enzyme and Jest, it takes 45 seconds on my local mac to run npm install and jest. The first time I run tests on SemaphoreCI, the tests complete in 60seconds, which is incredible. Even more amazing is that the continuous integration tests complete 4 times as fast the second time...in 16 seconds! Continuous integration with SemaphoreCI means that pull requests are flagged as ready-to-merge much faster, which means your workflow is far less hindered.
-~-~~-~~~-~~-~-
Also watch: "Tailwind CSS - why CSS utility classes save so much time"
https://www.youtube.com/watch?v=oU5ar0dmQEY
-~-~~-~~~-~~-~-
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from LearnCode.academy · LearnCode.academy · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Web Development Tutorial for Beginners (#1) - How to build webpages with HTML, CSS, Javascript
LearnCode.academy
Web Development Tutorial for Beginners (#2) - Basic CSS - How to build a website with HTML & CSS
LearnCode.academy
How to create CSS Layouts - Web Development Tutorial for Beginners (#3) - with HTML & CSS
LearnCode.academy
Bootstrap Tutorial For Beginners - Responsive Design with Bootstrap 3 - Responsive HTML, CSS
LearnCode.academy
Angularjs Tutorial for Beginners - learn Angular.js using UI-Router
LearnCode.academy
CSS Tutorial - Web Development Tutorial for Beginners (#5)
LearnCode.academy
Node.js tutorial for beginners - an introduction to Node.js with Express.js
LearnCode.academy
Github Tutorial For Beginners - Github Basics for Mac or Windows & Source Control Basics
LearnCode.academy
Javascript Tutorial - Programming Tutorial for Beginners Pt 1
LearnCode.academy
Javascript Tutorial - jQuery Tutorial for Beginners Pt 2
LearnCode.academy
AngularJS Directives Tutorial - Part 1 - Demystifying Angular Directives
LearnCode.academy
WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice
LearnCode.academy
YEOMAN TUTORIAL - Master Front-End Workflow with Yeoman, Grunt and Bower
LearnCode.academy
BOWER! - Streamline Web Workflow with Bower Package Manager
LearnCode.academy
Chrome DevTools for CSS - Better CSS Coding & CSS Debugging with Developer Tools
LearnCode.academy
GITHUB ATOM - Why Atom.io will be your favorite Text Editor!
LearnCode.academy
GITHUB PULL REQUEST, Branching, Merging & Team Workflow
LearnCode.academy
Pimp that Terminal - Add shortcuts and functions to your .bash_profile to simplify routine tasks
LearnCode.academy
jQuery Tutorial #3 - Writing Smarter, Better Code - jQuery Tutorial for Beginners
LearnCode.academy
jQuery Tutorial #2 - Event Binding - jQuery Tutorial for Beginners
LearnCode.academy
jQuery Tutorial #1 - jQuery Tutorial for Beginners
LearnCode.academy
Node.js MongoDB Tutorial using Mongoose
LearnCode.academy
Node.js tutorial for beginners 2014 - an introduction to Node.js with Express.js
LearnCode.academy
WEB DEVELOPMENT - SECRETS TO STARTING A CAREER in the Web Development Industry
LearnCode.academy
jQuery Tutorial #4 - DOM Traversal with jQuery
LearnCode.academy
jQuery Tutorial #5 - Building a jQuery Tab Panel Widget
LearnCode.academy
jQuery Tutorial #6 - Building a jQuery Image Slider
LearnCode.academy
jQuery Ajax Tutorial #1 - Using AJAX & API's (jQuery Tutorial #7)
LearnCode.academy
jQuery Ajax Tutorial #2 - Posting data to backend (jQuery tutorial #8)
LearnCode.academy
jQuery Ajax Tutorial #3 - Delegating Events & Mustache.js Templating (jQuery tutorial #9)
LearnCode.academy
jQuery Ajax Tutorial #4 - "Edit" modes & Better Mustache.js Templating (jQuery tutorial #9)
LearnCode.academy
How to put your website online - how to FTP to a domain & upload files to a webhost
LearnCode.academy
Basic Terminal Usage - Cheat Sheet to make the command line EASY
LearnCode.academy
SSH Tutorial - Basic server administration with SSH
LearnCode.academy
Vagrant Tutorial - Running a VM For Your Local Development Environment
LearnCode.academy
Sublime Text Favorite Packages and Workflow
LearnCode.academy
What Makes Javascript Weird...and AWESOME - Pt 1
LearnCode.academy
Javascript is Event-Driven - What makes Javascript Weird...and Awesome Pt 2
LearnCode.academy
Javascript Closures Tutorial - What makes Javascript Weird...and Awesome Pt 3
LearnCode.academy
FREE REST API - Practice Developing Javascript AJAX Apps with this API
LearnCode.academy
Javascript Scope Tutorial - What Makes Javascript Weird...and Awesome Pt 4
LearnCode.academy
Javascript Context Tutorial - What makes Javascript Weird...and Awesome Pt5
LearnCode.academy
Nginx Tutorial - Proxy to Express Application, Load Balancer, Static Cache Files
LearnCode.academy
Live Reload Sublime, Chrome, Anything - Fast and easy with Live-Server
LearnCode.academy
Are you bad, good, better or best with Async JS? JS Tutorial: Callbacks, Promises, Generators
LearnCode.academy
Javascript Generators - THEY CHANGE EVERYTHING - ES6 Generators Harmony Generators
LearnCode.academy
Web Development Advice - Interview with Dev Tips
LearnCode.academy
How the Internet Works for Developers - Pt 2 - Servers & Scaling
LearnCode.academy
How the Internet Works for Developers - Pt 1 - Overview & Frontend
LearnCode.academy
HAPROXY vs NGINX - 10,000 requests while killing servers
LearnCode.academy
Node.js Cluster - Boost Node App Performance & Stability with Clustering
LearnCode.academy
Web Dev Training with Treehouse
LearnCode.academy
What is Node.js Exactly? - a beginners introduction to Nodejs
LearnCode.academy
How to deploy node.js applications #1 - spin up a server
LearnCode.academy
Deploying node.js applications #2 - provision server & setup flightplan
LearnCode.academy
Deploying Node.js Applications - Deploy Node the right way - as an Upstart Service
LearnCode.academy
Mobile Web Design - Coding Workflow For Mobile Websites
LearnCode.academy
WHY YOU NEED A BUILD SYSTEM LIKE GRUNT, GULP, BRUNCH FOR YOUR WEBSITE
LearnCode.academy
GRUNT TUTORIAL - Grunt makes your web development better!
LearnCode.academy
STOP USING FTP! - How to Deploy with Flightplan over SSH
LearnCode.academy
More on: CI/CD Pipelines
View skill →Related Reads
📰
📰
📰
📰
Why SnapDOM Beats html2canvas for DOM-to-Image Capture
Dev.to · Juan Martin
I built 42 landing page templates as single HTML files (no npm, no build step)
Dev.to · Segcam spa
Part 7B — Section 2 — React Event Handling Explained: Forms, Event Object & User Input.
Medium · JavaScript
Stop Using window.resize for Everything: A Practical Guide to the ResizeObserver API
Medium · JavaScript
🎓
Tutor Explanation
DeepCamp AI