<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Neenad Ingole on Medium]]></title>
        <description><![CDATA[Stories by Neenad Ingole on Medium]]></description>
        <link>https://medium.com/@iamninad?source=rss-abc49bb292ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tvV2a0AFUGwSLtNatsncpA.png</url>
            <title>Stories by Neenad Ingole on Medium</title>
            <link>https://medium.com/@iamninad?source=rss-abc49bb292ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 07:10:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamninad/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Improve Visibility Even While Pair Programming]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/improve-visibility-even-while-pair-programming-bef5b292fa9?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2600/0*z_OY-ZNc7HzX4z68" width="5058"></a></p><p class="medium-feed-snippet">Three things a developer should do to bring visibility to their work while pair programming</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/improve-visibility-even-while-pair-programming-bef5b292fa9?source=rss-abc49bb292ff------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/improve-visibility-even-while-pair-programming-bef5b292fa9?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/bef5b292fa9</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[developer-productivity]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Thu, 25 May 2023 02:45:18 GMT</pubDate>
            <atom:updated>2023-05-30T16:35:03.441Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Secret For Testing UUID Generation in Golang]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/secret-for-testing-uuid-generation-in-golang-9b16e797c37f?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2048/0*Dbp0vhnGEFp3NMdB" width="2048"></a></p><p class="medium-feed-snippet">Learn different ways to unit test UUID generation in golang using google/uuid and go-cmp library</p><p class="medium-feed-link"><a href="https://itnext.io/secret-for-testing-uuid-generation-in-golang-9b16e797c37f?source=rss-abc49bb292ff------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/secret-for-testing-uuid-generation-in-golang-9b16e797c37f?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b16e797c37f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Mon, 08 May 2023 03:04:08 GMT</pubDate>
            <atom:updated>2023-05-09T18:21:40.267Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Keep Watch Over Your SQL Queries in IntelliJ, Goland, or DataGrip]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/keep-watch-on-sql-query-in-intellij-goland-or-datagrip-45a780a0c7ef?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2600/0*aNzNLOdi5Mh7Yrte" width="3500"></a></p><p class="medium-feed-snippet">Learn how to monitor your SQL query results in Jetbrains&#x2019; products</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/keep-watch-on-sql-query-in-intellij-goland-or-datagrip-45a780a0c7ef?source=rss-abc49bb292ff------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/keep-watch-on-sql-query-in-intellij-goland-or-datagrip-45a780a0c7ef?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/45a780a0c7ef</guid>
            <category><![CDATA[datagrip]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[goland]]></category>
            <category><![CDATA[intellij]]></category>
            <category><![CDATA[jetbrains]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Tue, 18 Apr 2023 17:14:17 GMT</pubDate>
            <atom:updated>2023-04-18T17:15:24.225Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Preventing DB Connection Leak in Golang: Lessons from a Billion Dollar Mistake]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/preventing-db-connection-leak-in-golang-fcf620469aad?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2600/0*VtyUdmvcpLx4kCl2" width="5306"></a></p><p class="medium-feed-snippet">Learn how to validate your transaction abstraction layer is perfect with unit and integration test</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/preventing-db-connection-leak-in-golang-fcf620469aad?source=rss-abc49bb292ff------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/preventing-db-connection-leak-in-golang-fcf620469aad?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcf620469aad</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[transactions]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Mon, 03 Apr 2023 08:56:42 GMT</pubDate>
            <atom:updated>2023-04-07T16:57:33.313Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Billion Dollar Go Mistake]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/a-billion-dollar-go-mistake-820338199998?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2600/0*cGoLKvIkbfKzRHPw" width="6000"></a></p><p class="medium-feed-snippet">A small golang mistake that could cost a Million Dollars.</p><p class="medium-feed-link"><a href="https://itnext.io/a-billion-dollar-go-mistake-820338199998?source=rss-abc49bb292ff------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/a-billion-dollar-go-mistake-820338199998?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/820338199998</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[transactions]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Thu, 09 Mar 2023 08:42:46 GMT</pubDate>
            <atom:updated>2023-05-27T16:35:18.838Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Docker Compose For Your Next Debezium And Postgres Project]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/docker-compose-for-your-next-debezium-and-postgres-project-47b6565560d5?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2600/0*9vjistGioA14ccRI" width="5760"></a></p><p class="medium-feed-snippet">Working on Debezium and Postgres? This guide will help you to quick setup the services using docker-compose</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/docker-compose-for-your-next-debezium-and-postgres-project-47b6565560d5?source=rss-abc49bb292ff------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/docker-compose-for-your-next-debezium-and-postgres-project-47b6565560d5?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/47b6565560d5</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[debezium]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Wed, 15 Feb 2023 09:50:16 GMT</pubDate>
            <atom:updated>2023-04-07T16:57:20.598Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Set Up Docker Compose For Prometheus + Grafana]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@iamninad/how-to-set-up-docker-compose-for-prometheus-grafana-f893252a4fe2?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/1080/0*rjH2BISBPAqjQnLN.jpeg" width="1080"></a></p><p class="medium-feed-snippet">With all the tools you have in production, it&#x2019;s important that you can effortlessly test the user flows end-to-end, locally. The rationale&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@iamninad/how-to-set-up-docker-compose-for-prometheus-grafana-f893252a4fe2?source=rss-abc49bb292ff------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@iamninad/how-to-set-up-docker-compose-for-prometheus-grafana-f893252a4fe2?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/f893252a4fe2</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 18:40:48 GMT</pubDate>
            <atom:updated>2023-03-10T08:50:51.238Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Github Code Scanning]]></title>
            <link>https://medium.com/technogise/github-code-scanning-5cc2c7f9f0e7?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cc2c7f9f0e7</guid>
            <category><![CDATA[code-scanning]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[codeql]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Sun, 26 Jul 2020 06:32:14 GMT</pubDate>
            <atom:updated>2023-05-07T06:20:43.447Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q3YWXPs3uSVq0Gaa" /><figcaption>Photo by <a href="https://unsplash.com/@caleb_white?utm_source=medium&amp;utm_medium=referral">Caleb White</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have you ever done <strong>code scanning</strong> of your code for vulnerabilities or errors before? No? Don’t worry even I wasn’t aware of the same when I started my career as a developer. Many organizations follow this as a best practice and a must before moving their applications to production. This helps to mitigate any security vulnerabilities or errors in the application after it is deployed to production, thereby avoiding any business impact or monetary losses.</p><p>There are many code scanning tools available. Some are proprietary licensed products, while others are free tools. But they all require some efforts to set up with your existing CI/CD setup. The one which I have seen is <a href="https://www.veracode.com/"><strong>Veracode</strong></a>, which is a proprietary product and provides information about any security risk or code error by scanning the entire code base… even the dependencies I believe. And then there is <a href="https://www.sonarqube.org/"><strong>SonarQube</strong></a>; widely used by many organizations and many of you might be aware of. It’s a static code analyser and provides information regarding any security risk or code error.</p><p><strong>GitHub</strong>, which is the most popular platform for open source development, has also come up with a new service that allows code scanning of the repository for security vulnerabilities and any coding errors. You can use GitHub code scanning to find, triage, and prioritise fixes for existing problems in your code. It also prevents developers from introducing new problems. You can schedule scans for specific days and times, or trigger scans when a specific event occurs in the repository, such as a push.</p><p>If code scanning finds a potential vulnerability or error in your code, GitHub displays an alert in the repository. After you fix the code that triggered the alert, GitHub closes the alert. GitHub Code Scanning is a new service and is still in <strong>beta. </strong>Lots of scanning rules are still work in progress. For example, passwords leaked in Java properties file is still not available. However, as the service becomes more stable, we will have all such cases available in CodeQL rules database.</p><p>By default, code scanning uses <strong>CodeQL</strong>, a semantic code analysis engine. CodeQL treats code as data, allowing you to find potential vulnerabilities in your code with greater confidence than traditional static analyzers. You can use CodeQL to find all variants of vulnerability, and remove all those variants from your code.</p><p><strong>QL</strong> is the query language that powers CodeQL. It is an object-oriented logic programming language. GitHub, language experts, and security researchers create the queries used for code scanning, and the queries are open source. The community maintains and updates the queries to improve analysis and reduce false positives. For more information, see <a href="https://securitylab.github.com/tools/codeql"><strong>CodeQL</strong></a> on the GitHub Security Lab website.</p><p>In this short <strong>tutorial</strong>, will see how to configure code scanning for a Java-based project. Code scanning supports both compiled and interpreted languages and can find vulnerabilities and errors in code that’s written in the following supported languages:</p><ul><li>C/C++</li><li>C#</li><li>Go</li><li>Java</li><li>JavaScript/TypeScript</li><li>Python</li></ul><blockquote><em>Github Code Scanning is still in beta and access is limited to users on an invitation basis. Follow the steps below when you have access to the service</em></blockquote><h3>Let’s start 🏃🏻‍♂️</h3><p>The first thing you need to do is navigate to the security tab of the repository</p><figure><img alt="Security Tab In Main Section" src="https://cdn-images-1.medium.com/max/642/1*4XAniOK-X7VwzADKI4aC6A.png" /><figcaption>Security Tab In Main Section</figcaption></figure><p>Then you will see the screen below, and the last option you will see <strong>“Code scanning alerts”</strong>, click on the Setup code scanning button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWOH9oTSUeoqNdSbvAhA5g.png" /><figcaption>Security Options</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B5mjNG9QwGrK7OXAOeAKkg.png" /><figcaption>Security Scanning Setup</figcaption></figure><p>Code scanning uses Github Actions, You will see the above screen for CodeQL analysis setup. Along with this, you will also see many different options from marketplace to setup like “Anchore Container Scan”, “OSSAR” etc. However, for this post we will be going with the <strong>default</strong> action workflow. Click on the Setup this workflow button for CodeQL analysis, and you will be prompted with the screen below to configure the workflow YAML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zn9IIVEeNQSg1UKK-RhrWg.png" /><figcaption>CodeQL Workflow setup screen</figcaption></figure><p>When you see the configuration click on Start commit and create a commit with the basic configuration. We will do the modifications afterwards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*aVidFdyGnIdRupBczZjrTg.png" /><figcaption>Commit Dialog</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDT_x7Y6svXhLi0iJBohAw.png" /><figcaption>Committed CodeQL analysis file</figcaption></figure><p>Take a pull in from your repository so that you have the workflow YAML available to modify. Open the file in the .github/workflow directory and modify the configuration as per your requirement.</p><p>Below are the configurations that I have done for this post:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cf7ce18b0328b1061f1e48d785e5697/href">https://medium.com/media/8cf7ce18b0328b1061f1e48d785e5697/href</a></iframe><p>I have modified a few things from the given workflow. For e.g, I have disabled the cron scheduled option. This makes the security scan to run on given cron expression, the option push enables the scan to run on every commit push to the remote, and the similar pull_request will happen for every pull request. However in an attempt, when I ran a full pack of security rules that took 19min.</p><p>In such case, I would recommend setting up the Security scanning as a cron <strong>once in a day,</strong> preferably a <strong>nightly build</strong> so that your team will get to see the results of the security scan, first thing next morning and can prioritise fixing the bugs first.</p><p>Another change I’ve done is I’ve added a configuration in the file .github/codeql-config.yml to initialize CodeQL step as below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49977ec7bf48614be2028c37bbbadd3c/href">https://medium.com/media/49977ec7bf48614be2028c37bbbadd3c/href</a></iframe><p>The CodeQL actions codeql-action/init@v1 can find the programming language by its auto-detection feature. It is something that is embedded in the action by Github developers. However, I have explicitly added Java so that the step doesn&#39;t have to do that extra detection work and saves time. At the same time, I like to make things <strong>readable</strong> instead of the abstraction magic. This helps anyone new joining your team figure out how things are configured.</p><p>Then there are queries options. These allow you to specify <strong>additional scan rules</strong>. Two are inbuilt in the CodeQL tool which I have specified security-extended and security-and-quality. However there are also many additional security rules on GitHub&#39;s CodeQL repo. You can find them <a href="https://github.com/github/codeql"><strong>here</strong></a><strong>.</strong> When I first added the entire repo (which was more than 800 rules), it took a lot of time and many of them were not useful for my experiment purpose.. so I selected a smaller subset of those.</p><p>There is a syntactic way to provide the configuration as shown below. In order to run the custom queries, you need to disable the default queries by setting disable-default-queries: true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxCmTAu-ujxZRPIg8hEQBg.png" /><figcaption>Different ways to provide custom CodeQL queries</figcaption></figure><p>Different ways to provide custom CodeQL queries</p><p>In the configurations, I have provided github/codeql/java/ql/src/codeql-suites/<a href="https://iamninad.com/cdn-cgi/l/email-protection">[email protected]</a>. This is the path to the <strong>actual</strong> <strong>GitHub </strong><a href="https://github.com/github/codeql/tree/master/java/ql/src/codeql-suites"><strong>link</strong></a> and I have tagged the rules for version 1.24.0. You can also point to the master as shown in the above configuration guide.</p><p>After you have done the configuration, create a new commit and push. You will see a new scan action triggered, which you can view in the Actions section of the <a href="https://github.com/ninadingole/github-codescan/actions">GitHub repo page</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x-3jPudQTNG6Rcv9N_b9Lg.png" /><figcaption>All Actions</figcaption></figure><p>Clicking on the individual action run will show you additional information about the scan process in the <strong>log</strong> which is provided for the step navigate in the Perform CodeQL Analysis section. You can see what all security rules were checked against the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBebT1Lf_gcnWbDuQBNJjQ.png" /><figcaption>Log for Action Workflow</figcaption></figure><p>Once the workflow is completed without any error, to check any security vulnerability or error in the code navigate to the Security Tab. The badge also shows the number of security risks that are present in the code. I liked this as the information is available right there on the main page of your repo and this way team can prioritise bugs to be fixed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*asbDaVRQGXqjdI465ZK5gg.png" /><figcaption>Total number of Security risk found</figcaption></figure><p>If you click on it and move to the code scanning alerts you can see all the vulnerabilities that are available in the code listed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DHyWWgjGy355gkxradqFA.png" /><figcaption>Listing of all the risks</figcaption></figure><p>The listing shows the message of the issue found, the file in which the issue was detected with the line number (very cool 🙂) and the branch in which the issue was found. Further clicking on any issue, you can drill down into the actual code. The UI highlights the line of code which has the issue, whether it’s a warning or an actual error and more details like the commit that caused the issue, the rule that failed etc. The UI also tags the issues based on the rules category. In the below image you can see the error are tagged as CWE-798 and security</p><p>You can see the details of two errors which are security risks to my code are listed below (deliberately added for demo purpose 😛). One is because of the password leaked into the source code and the other is directly redirecting to the user-provided URL without first validating the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3gAeiUIyZD0NobfUomqB2w.png" /><figcaption>Password in source code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYZHFyjARVcrcl-KZckxIw.png" /><figcaption>URL redirection without validation</figcaption></figure><p>If you click on the small show more dropdown, you can see a good help about the issue and how to avoid it. There are also links to some reference documentation that explains the issue in depth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuVkR-lLd79xGDTNbcd4gQ.png" /><figcaption>Recommendation for the cause of the issue</figcaption></figure><p>Once you have fixed the issue and the code is pushed the issue will be moved to close. However, at times there will be cases of false-positives in such cases. There is an option provided at the top right of the issue, to manually close the issue, and has three options shown in below image, select one that suits your use case and close the issues which are not valid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*jx6bkRz0a2mcZqkh2llzkw.png" /><figcaption>Options to close the issue</figcaption></figure><p>I hope this post helps you. If you don’t see the option to enable the security scan on your repository, don’t worry the tool is still in beta and access is given on invitation basis by Github. Get an invite for the service if you want to try out. It will be accessible to everyone soon.</p><p>The post gives a basic idea of how the scanning will work with repository. There are many open-source tools, and their workflows available in the GitHub marketplace that you can try. However, this post will help you to get started with basic.</p><p>Happy Coding!</p><h3>References:</h3><ul><li><a href="https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning">Github CodeQL</a></li><li><a href="https://github.com/github/codeql/">Github CodeQL Additional Queries</a></li><li><a href="https://github.com/github/codeql-go">CodeQL for Golang</a></li><li><a href="https://github.com/ninadingole/github-codescan">Example Code Github Repo</a></li></ul><p><em>Originally published at </em><a href="https://www.iamninad.com/posts/github-code-scanning/"><em>https://iamninad.com</em></a><em> on July 26, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cc2c7f9f0e7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/technogise/github-code-scanning-5cc2c7f9f0e7">Github Code Scanning</a> was originally published in <a href="https://medium.com/technogise">Technogise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Organizing Scala Tests For Faster Feedback]]></title>
            <link>https://medium.com/@iamninad/organizing-scala-tests-for-faster-feedback-ba0039357ff9?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba0039357ff9</guid>
            <category><![CDATA[scalatest]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[bts]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Mon, 18 Mar 2019 03:20:37 GMT</pubDate>
            <atom:updated>2023-05-07T06:20:05.725Z</atom:updated>
            <content:encoded><![CDATA[<p>Writing tests is a developer’s mundane task, and when you follow practices like TDD or BDD, hardly you find any code without any test cases. We all might have seen the testing pyramid in agile and if not then you can read this <a href="https://martinfowler.com/articles/practical-test-pyramid.html">blog</a> by Martin Fowler on the testing pyramid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*wXEwE3c3wa6yJ8L1.png" /></figure><p>In short and crisp, tests gets divided into three categories: <em>unit test, integration/service test, and e2e/UI tests</em>. The unit test validates the functionality of each class and written on per class basis, integration test checks for the functionality of module with external systems like database, web service, and UI/e2e test the entire business flow or UI flow.</p><p>As you can see from the test pyramid, we should have more integration test than e2e test and more unit test than the integration test. The reason for having less integration and e2e tests is “time”; Integration test and e2e test interacts typically with other systems which are external or internal like in-memory DB or clusters. These tests take time to execute and are often slower.</p><p>And not to mention we have our CD/CI pipelines which run these tests and generate our code artifact. We also want our CI to provide us faster feedback by running these test individually, so we don’t have to wait longer if there is an issue at the unit level.</p><p>Currently, I am working on a Big Data project which includes frameworks like Spark, HBase, Kafka, HDFS, etc. Some of our unit tests are independent of any spark code, and some unit test does require spark context, but they do not interact with external systems like HDFS and HBase. Moreover, integration test, runs an in-memory HBase cluster, in-memory mini dfs cluster and spark of course :P. Now, these integration test shares the single running clusters amongst them and executes sequentially.</p><p>We have SBT as the build tool and, we have disabled the parallel execution of tests which makes the entire test suite including the unit test to run slower. I am struggling with that sometimes have to wait for 10–15mins to get the feedback about my code changes, running unit tests also runs integration test which takes time for cluster initialization of HBase and HDFS, and I was seriously looking for some alternative to this issue. Seldom I do comment out my integration suite code only to run the unit test which is again a wrong way. We need some mechanism to organize our tests such that we can execute them separately as a suite of unit, integration and e2e tests and, we only have parallel execution disabled for integration and e2e tests. It would provide developers with quick feedback by just running the unit tests.</p><p>In this post, I am going to share my findings on how to organize the tests and configure sbt (<strong>v1.2.8</strong>) such that it enables us to run these different scala test independently without any code hacks or commenting your test cases which is a more of an ugly way.</p><h3>Integration Test</h3><p>Integration Test setting comes default in SBT. It’s just a matter of configuring the modules with these settings in the build.sbt.</p><pre>lazy val module1 = (project in file(&quot;module1&quot;)) .configs(IntegrationTest) <br>.settings( <br>    Defaults.itSettings, libraryDependencies += scalatest % &quot;it,test&quot; <br>)</pre><p>Adding “it, test” at the end of dependencies enables that lib to be available to both standard unit test &amp; integration test packages. After this, you have a new location to write an integration test.</p><pre>src/it/scala <br>src/it/java <br>src/it/resources</pre><p>I have created an integration test per module and placed in the above location now to execute the integration test use IntegrationTest / testOnly or it:test in SBT console, and the output as:</p><pre>[info] Compiling 1 Scala source to /Users/neenad/codes/tutorials/scala/sbt-learnings/module1/target/scala-2.11/it-classes ...<br>[info] Run completed in 9 milliseconds.<br>[info] Total number of tests run: 0<br>[info] Suites: completed 0, aborted 0<br>[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0<br>[info] No tests were executed.<br>this is a integration test<br>[info] Module2IntegrationTest1:<br>[info] - integration test<br>[info] Run completed in 194 milliseconds.<br>[info] Total number of tests run: 1<br>[info] Suites: completed 1, aborted 0<br>[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0<br>[info] All tests passed.<br>[info] Done compiling.<br>module1 integration test<br>[info] Module1IntegrationTest:<br>[info] - integration test<br>[info] Run completed in 134 milliseconds.<br>[info] Total number of tests run: 1<br>[info] Suites: completed 1, aborted 0<br>[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0<br>[info] All tests passed.<br>[success] Total time: 2 s, completed 17 Mar, 2019 5:52:42 PM</pre><h3>End-To-End Tests</h3><p>Like integration test end-to-end configuration is not provided by SBT. We would need to create them and apply to the module. I have created an E2E object in the project folder and, the contents are as below:</p><pre><strong>import </strong>sbt.<em>{</em>Configuration, Defaults, <em>Test</em>, inConfig<em>}<br></em><strong>import </strong>sbt._<br><strong>import </strong>sbt.Keys._<br><br><strong>object </strong>E2E <em>{<br>  </em><strong>final val </strong><em>E2ETest </em>= <em>Configuration</em>.<em>of(</em>&quot;EndToEndTest&quot;, &quot;e2e&quot;<em>) </em>extend <em>(Test)<br><br>  </em><strong>final val </strong><em>e2eSettings </em>=<br>    inConfig(E2ETest)(e2eConfig)<br><br>  <strong>lazy val </strong>e2eConfig = Defaults.configSettings ++ Defaults.testTasks ++ Seq(<br>    scalaSource in E2ETest := baseDirectory.value / &quot;src&quot; / &quot;e2e&quot; / &quot;scala&quot;,<br>    javaSource in E2ETest := baseDirectory.value / &quot;src&quot; / &quot;e2e&quot; / &quot;java&quot;,<br>    resourceDirectory in E2ETest := baseDirectory.value / &quot;src&quot; / &quot;e2e&quot; / &quot;resources&quot;<strong><br>  </strong>)<br><br>}</pre><p>Now apply these settings to your modules and add e2e to the library dependencies as we did with the integration test</p><pre>lazy val module1 = (project in file(&quot;module1&quot;))<br>  .configs(IntegrationTest)<br>  .configs(E2ETest)<br>.settings(<br>  E2E.e2eSettings,<br>  Defaults.itSettings,<br>  libraryDependencies += scalatest % &quot;it,test,e2e&quot;,<br>    name := &quot;module1&quot;,<br>  version := &quot;0.1&quot;<br>)<br><br>lazy val module2 = (project in file(&quot;module2&quot;))<br>  .configs(IntegrationTest)<br>  .configs(E2ETest)<br>  .settings(<br>    Defaults.itSettings,<br>    libraryDependencies += scalatest % &quot;it,test,e2e&quot;,<br>      E2E.e2eSettings,<br>    name := &quot;module2&quot;,<br>    version := &quot;0.1&quot;<br>  )<br><br>lazy val root = (project in file(&quot;.&quot;))<br>  .configs(IntegrationTest)<br>  .configs(E2ETest)<br>  .aggregate(module1, module2)<br>  .enablePlugins(Common)<br>  .settings(<br>    E2E.e2eSettings,<br>    Defaults.itSettings,<br>    libraryDependencies += scalatest % &quot;it,test,e2e&quot;<br>  )</pre><p>we can now create our e2e tests inside the following folders</p><pre>src/e2e/scala<br>src/e2e/java<br>src/e2e/resources</pre><p>To run the e2e test use EndToEndTest / test or e2e:test in sbt. This command runs only the integration test as shown below:</p><pre>[info] Run completed in 10 milliseconds.<br>[info] Total number of tests run: 0<br>[info] Suites: completed 0, aborted 0<br>[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0<br>[info] No tests were executed.<br>this is e2e test<br>[info] Module1E2ETest:<br>[info] - module1 e2e test<br>[info] Run completed in 172 milliseconds.<br>[info] Total number of tests run: 1<br>[info] Suites: completed 1, aborted 0<br>[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0<br>[info] All tests passed.<br>module2 e2e test<br>[info] Module2E2ETest:<br>[info] - module2 e2e test<br>[info] Run completed in 250 milliseconds.<br>[info] Total number of tests run: 1<br>[info] Suites: completed 1, aborted 0<br>[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0<br>[info] All tests passed.<br>[success] Total time: 1 s, completed 17 Mar, 2019 5:53:46 PM</pre><h3>Unit Test?</h3><p>Now, what remains are the unit tests and configuring the unit tests is relatively straightforward. You don’t have to do anything at all. 😄 Any test under package src/test/scala gets considered as a unit test and to execute it you have to use your standard test task in sbt, this runs all the unit test in your module:</p><pre>[info] Compiling 1 Scala source to /Users/neenad/codes/tutorials/scala/sbt-learnings/module1/target/scala-2.11/test-classes ...<br>[info] Run completed in 9 milliseconds.<br>[info] Total number of tests run: 0<br>[info] Suites: completed 0, aborted 0<br>[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0<br>[info] No tests were executed.<br>module2 sample unit test<br>[info] Module2UnitTest:<br>[info] - sample test<br>[info] Run completed in 202 milliseconds.<br>[info] Total number of tests run: 1<br>[info] Suites: completed 1, aborted 0<br>[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0<br>[info] All tests passed.<br>[info] Done compiling.<br>module1 sample unit test<br>Hello World<br>[info] Module1UnitTest:<br>[info] - sample test<br>[info] Run completed in 142 milliseconds.<br>[info] Total number of tests run: 1<br>[info] Suites: completed 1, aborted 0<br>[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0<br>[info] All tests passed.<br>[success] Total time: 2 s, completed 17 Mar, 2019 6:06:45 PM</pre><h3>Disabling Parallel Execution:</h3><p>To disable parallel execution of the e2e test in our code add below line in our E2E settings</p><pre>E2ETest / parallelExecution := false</pre><h3>Code:</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6181afc5d6f229500f3afb23b0ffed80/href">https://medium.com/media/6181afc5d6f229500f3afb23b0ffed80/href</a></iframe><h3>Resources</h3><ul><li><a href="https://www.scala-sbt.org/1.x/docs/">https://www.scala-sbt.org/1.x/docs/</a></li><li>Test Pyramid by 360logica.com</li></ul><p>I hope this post helps you to organize your tests such that you get faster feedback by running tests independently and don’t have to survive the pain I went through in your project. If you have any doubt, please comment and don’t forget to share &amp; clap 👏🏼.</p><p><em>Originally published at </em><a href="https://www.iamninad.com/posts/organizing-scala-tests-for-faster-feedback/"><em>iamninad.com</em></a><em> on March 18, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba0039357ff9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to Setup Golden Gate On Vagrant Box]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/the-ultimate-guide-to-setup-golden-gate-on-vagrant-box-5f73fc67ebd6?source=rss-abc49bb292ff------2"><img src="https://cdn-images-1.medium.com/max/2600/0*Lfeii5UcLLjmqZPK" width="4623"></a></p><p class="medium-feed-snippet">If you have read my previous post on Debezium, I have mentioned that currently, I am working on a platform which includes capturing CDC&#x2026;</p><p class="medium-feed-link"><a href="https://itnext.io/the-ultimate-guide-to-setup-golden-gate-on-vagrant-box-5f73fc67ebd6?source=rss-abc49bb292ff------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/the-ultimate-guide-to-setup-golden-gate-on-vagrant-box-5f73fc67ebd6?source=rss-abc49bb292ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f73fc67ebd6</guid>
            <category><![CDATA[cdc]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[golden-gate]]></category>
            <category><![CDATA[confluent]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Neenad Ingole]]></dc:creator>
            <pubDate>Sun, 22 Jul 2018 16:44:34 GMT</pubDate>
            <atom:updated>2023-05-07T06:19:21.808Z</atom:updated>
        </item>
    </channel>
</rss>