<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Continuous testing pipeline &#8211; Best DevOps</title>
	<atom:link href="https://www.bestdevops.com/tag/continuous-testing-pipeline/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bestdevops.com</link>
	<description>Lets Learn, Do it &#38; Share! Thats a Best DevOps!!!</description>
	<lastBuildDate>Mon, 12 Oct 2026 07:50:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>How to Set Up a Continuous Testing Pipeline with Node.js</title>
		<link>https://www.bestdevops.com/tutorial-set-up-a-continuous-testing-pipeline-with-node-js/</link>
					<comments>https://www.bestdevops.com/tutorial-set-up-a-continuous-testing-pipeline-with-node-js/#respond</comments>
		
		<dc:creator><![CDATA[anil]]></dc:creator>
		<pubDate>Fri, 24 Mar 2017 12:05:58 +0000</pubDate>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[DevOps Best Practices]]></category>
		<category><![CDATA[DevOps Tools]]></category>
		<category><![CDATA[Continuous Deployment]]></category>
		<category><![CDATA[Continuous testing]]></category>
		<category><![CDATA[Continuous testing pipeline]]></category>
		<category><![CDATA[Heroku]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://www.bestdevops.com/?p=1034</guid>

					<description><![CDATA[Learn how to build a complete continuous development pipeline that automatically builds, deploys, and tests a Node.js application using GitHub, CircleCI, Heroku, and Assertible.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Continuous integration is a well-established part of modern development workflows. Most teams are already familiar with CI services that automatically build code whenever new changes are pushed to a repository. But the real power comes from extending that pipeline further — not just building your code, but also <strong>deploying</strong> it and <strong>testing</strong> it automatically within the same workflow. This broader practice is often called <strong>continuous development</strong> (or a full CI/CD/CT pipeline).</p>



<figure class="wp-block-image"><img decoding="async" src="https://s3-us-west-2.amazonaws.com/assertible/blog/continuous-development-diagram-horizontal.png" alt="Continuous development pipeline diagram showing build, deploy, and test stages" /><figcaption>A complete continuous development workflow: integrate, deploy, and test — automatically.</figcaption></figure>



<p class="wp-block-paragraph">This tutorial walks through each stage of that pipeline using a Node.js example application:</p>



<ul class="wp-block-list">
<li><strong>Continuous integration</strong>: Push code to GitHub; CircleCI automatically builds and runs unit tests.</li>
<li><strong>Continuous deployment</strong>: On a successful build, CircleCI deploys the application to Heroku.</li>
<li><strong>Continuous testing</strong>: After deployment, Assertible runs automated post-deployment API tests against the live application.</li>
</ul>



<p class="wp-block-paragraph">By the end, you will have a workflow that automatically builds, deploys, and tests your Node.js app after every push to your repository — with no manual steps required.</p>



<h2 class="wp-block-heading">Continuous Integration with CircleCI</h2>



<p class="wp-block-paragraph">The pipeline starts when code is pushed to a GitHub repository. CircleCI picks up the new changes, installs dependencies, and runs your unit tests. Setting this up requires just two things:</p>



<ol class="wp-block-list">
<li>Add a <code>circle.yml</code> configuration file to the root of your repository.</li>
<li>Connect the repository to CircleCI by adding it as a project in your CircleCI dashboard.</li>
</ol>



<p class="wp-block-paragraph">For a Node.js application, the default CircleCI settings are sufficient. CircleCI automatically detects Node.js projects and runs <code>npm install</code> followed by <code>npm test</code> without requiring any extra configuration in the YAML file.</p>



<p class="wp-block-paragraph">A minimal <code>circle.yml</code> for a Node.js project looks like this:</p>


<pre class="wp-block-code"><span><code class="hljs">machine:
  node:
    version: stable

test:
  post:
    - npm test</code></span></pre>


<p class="wp-block-paragraph">Once configured, every push to GitHub triggers a CircleCI build. If any unit test fails, the pipeline stops and the deployment step is never reached — protecting your production environment from broken builds.</p>



<figure class="wp-block-image"><img decoding="async" src="https://s3-us-west-2.amazonaws.com/assertible/blog/assertible-circleci-build-example.png" alt="CircleCI showing a successful build for a Node.js project" /><figcaption>A successful CircleCI build confirms all unit tests have passed before deployment begins.</figcaption></figure>



<h2 class="wp-block-heading">Continuous Deployment with Heroku</h2>



<p class="wp-block-paragraph">After a successful build, CircleCI executes the <code>deployment</code> block in <code>circle.yml</code>. In this example, the application is deployed to Heroku by pushing directly to the Heroku Git remote using the commit SHA captured in the <code>$CIRCLE_SHA1</code> environment variable.</p>


<pre class="wp-block-code"><span><code class="hljs language-php">deployment:
  production:
    branch: master
    commands:
      <span class="hljs-comment"># Deploy the app to Heroku</span>
      - git push git@heroku.com:your-app-name.git $CIRCLE_SHA1:refs/heads/master</code></span></pre>


<p class="wp-block-paragraph">This configuration tells CircleCI to trigger the production deployment only when changes are merged to the <code>master</code> branch. Feature branches will still be built and tested by CircleCI, but they will not be deployed to production.</p>



<p class="wp-block-paragraph">Key points about this deployment step:</p>



<ul class="wp-block-list">
<li>The Heroku SSH key must be added to CircleCI&#8217;s project settings so the <code>git push</code> is authenticated.</li>
<li>You can extend the <code>commands</code> list to run database migrations, flush caches, or perform any other pre- or post-deploy tasks.</li>
<li>Heroku review apps can be used alongside this pattern to create isolated staging environments for every pull request.</li>
</ul>



<figure class="wp-block-image"><img decoding="async" src="https://s3-us-west-2.amazonaws.com/assertible/blog/assertible-heroku-deploy-example.png" alt="Heroku deployment activity log showing a successful release" /><figcaption>Heroku&#8217;s activity log confirms each deployment was triggered automatically by CircleCI.</figcaption></figure>



<h2 class="wp-block-heading">Continuous Testing with Assertible</h2>



<p class="wp-block-paragraph">Unit tests verify your code in isolation, but they cannot tell you whether the live, deployed application is actually working correctly. That is where post-deployment testing comes in. After Heroku finishes the deployment, the pipeline uses Assertible to run a suite of API tests against the running application.</p>



<p class="wp-block-paragraph">Assertible listens for GitHub Deployment events. When it receives a <code>success</code> deployment status for a repository it is connected to, it automatically runs the API tests you have defined. The <code>github_deploy</code> helper script (provided by Assertible&#8217;s open-source <code>assertible/deployments</code> repository) sends these events from within your CircleCI build.</p>



<p class="wp-block-paragraph">Add the following steps to your <code>circle.yml</code> deployment commands, after the Heroku push:</p>


<pre class="wp-block-code"><span><code class="hljs language-php"><span class="hljs-comment"># Download the github_deploy helper script</span>
- curl https:<span class="hljs-comment">//raw.githubusercontent.com/assertible/deployments/master/github_deploy &gt; github_deploy</span>
- chmod +x github_deploy

<span class="hljs-comment"># Notify GitHub of the deployment, then mark it successful.</span>
<span class="hljs-comment"># Assertible listens for the 'success' event and triggers API tests.</span>
- |
  APPROOT=https:<span class="hljs-comment">//your-app-name.herokuapp.com/</span>
  DEPLOY_ID=$(ENVIRONMENT_NAME=<span class="hljs-string">"production"</span> ./github_deploy $CIRCLE_SHA1 $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME $APPROOT <span class="hljs-string">"pending"</span>)
  ./github_deploy $CIRCLE_SHA1 $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME $APPROOT <span class="hljs-string">"success"</span> $DEPLOY_ID</code></span></pre>


<p class="wp-block-paragraph">The script first creates a deployment record in GitHub with a <code>pending</code> status, capturing the resulting deployment ID. Once the deployment is confirmed live, it updates the status to <code>success</code>. Assertible detects this event and immediately executes the configured API test suite.</p>



<figure class="wp-block-image"><img decoding="async" src="https://s3-us-west-2.amazonaws.com/assertible/blog/assertible-deployment-results-example.png" alt="Assertible post-deployment test results showing API assertions passed" /><figcaption>Assertible runs API assertions against the newly deployed application and links results back to the triggering commit.</figcaption></figure>



<p class="wp-block-paragraph">This automated post-deployment testing catches issues that unit tests cannot — such as misconfigured environment variables, broken integrations with external services, or unexpected runtime errors in the deployed environment.</p>



<h3 class="wp-block-heading">Testing Staging Environments from Pull Requests</h3>



<p class="wp-block-paragraph">The same mechanism works for staging environments and Heroku review apps. When a pull request triggers a deployment to a staging environment, Assertible runs your API tests against that environment and reports the results as a GitHub status check directly on the pull request.</p>



<p class="wp-block-paragraph">This means reviewers can see at a glance whether the new changes pass API tests before merging — adding an additional quality gate beyond code review alone.</p>



<figure class="wp-block-image"><img decoding="async" src="https://s3-us-west-2.amazonaws.com/assertible/blog/assertible-status-checks.png" alt="GitHub pull request showing Assertible status checks for continuous testing" /><figcaption>Assertible reports API test results as GitHub status checks on pull requests, blocking merges if tests fail.</figcaption></figure>



<h2 class="wp-block-heading">Extending the Pipeline</h2>



<h3 class="wp-block-heading">Additional Automation with Heroku Add-ons</h3>



<p class="wp-block-paragraph">Heroku&#8217;s add-on ecosystem provides many ways to extend this workflow. You can automate database migrations, queue background jobs, flush CDN caches, or send deployment notifications to Slack — all as additional commands within the CircleCI deployment block.</p>



<h3 class="wp-block-heading">Using Other CI Providers</h3>



<p class="wp-block-paragraph">The core pattern described here — build, deploy, emit a GitHub deployment event, trigger automated tests — is not tied to any specific toolchain. The same approach works with other CI providers such as Travis CI, Jenkins, Wercker, or GitHub Actions. The key requirement is the ability to make an authenticated HTTP request (or run a shell script) that creates a GitHub Deployment event with a <code>success</code> status after deployment completes.</p>



<p class="wp-block-paragraph">Assertible&#8217;s open-source <code>assertible/deployments</code> repository contains scripts and documentation for integrating with multiple CI providers.</p>



<h2 class="wp-block-heading">Summary</h2>



<p class="wp-block-paragraph">A complete continuous development pipeline for a Node.js application can be assembled from three focused tools:</p>



<ul class="wp-block-list">
<li><strong>CircleCI</strong> handles building and unit testing on every push, and orchestrates the deployment step.</li>
<li><strong>Heroku</strong> receives the automated deployment and hosts the running application.</li>
<li><strong>Assertible</strong> listens for GitHub deployment events and runs post-deployment API tests to verify the live environment.</li>
</ul>



<p class="wp-block-paragraph">The result is a pipeline where every push to <code>master</code> automatically progresses through build, deploy, and test stages — with failures surfaced quickly at each gate, long before users are affected.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.bestdevops.com/tutorial-set-up-a-continuous-testing-pipeline-with-node-js/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
