teleren/devto huggingface dataset:
How to generate an aggregated test report for all Gradle subprojects
Tags: gradle, junit, kotlin
Published: 2020-07-08 06:53:29

**Note:** This article is outdated. The [Test Report Aggregation Plugin](https://docs.gradle.org/current/userguide/test_report_aggregation_plugin.html) can be used to achieve the same result with less effort.

With the plugin it all boils down to the example below.

With gradle:

```gradle
plugins {
    id 'test-report-aggregation'
}

tasks.named('check') {
    dependsOn tasks.named('testAggregateTestReport', TestReport)
}
```

With Kotlin:

```kotlin
plugins {
    id("test-report-aggregation")
}

tasks.check {
    dependsOn(tasks.named<TestReport>("testAggregateTestReport")) 
}
```

Read more about the plugin in the official documentation: https://docs.gradle.org/current/userguide/test_report_aggregation_plugin.html

--------------

When using Gradle's [multi-project builds](https://guides.gradle.org/creating-multi-project-builds/), test reports are generated separately in each build directory of every sub-project.

To make my CI server's life easier I often like to aggregate reports in a single build directory:

```kotlin
// build.gradle.kts

plugins {
    base
    kotlin("jvm") version "1.3.72" apply false
}

allprojects {
    group = "com.kaffeinelabs"
    version = "1.0.0-SNAPSHOT"
}

val testReport = tasks.register<TestReport>("testReport") {
    destinationDir = file("$buildDir/reports/tests/test")
    reportOn(subprojects.mapNotNull {
        it.tasks.findByPath("test") 
    })

subprojects {
    tasks.withType<Test> {
        useJUnitPlatform()
        finalizedBy(testReport)
        testLogging {
            events("passed", "skipped", "failed")
        }
    }
}
```

If you're interested in how to aggregate code coverage reports, I covered it in another article:

* [How to generate an aggregated code coverage report for all Gradle subprojects](https://dev.to/jakub_zalas/how-to-generate-an-aggregated-code-coverage-report-for-all-gradle-subprojects-3ga7)
Understanding Istio: part 16 – Observability / Metrics
Tags: kubernetes, devops, docker, beginners
Published: 2020-07-08 06:10:24

---
title: Understanding Istio: part 16 – Observability / Metrics
published: true
description: Serie of sketchnotes about Istio. Explaining in a visual way Istio principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Istio in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/800xos1k9x40le8u8b2d.jpg
---

Understanding Cloud technologies, like Kubernetes, can be difficult or time-consuming. In order to spread knowledges about it, I started to create [sketchnotes about Kubernetes](https://dev.to/aurelievache/kubernetes-sketchnotes-pods-4ib0) and know it's time to talk about a perfect companion of Kubernetes, a service mesh, Istio.

We continue our new serie of Sketchnotes about Istio, with a sketchnote about a part of Observability: Metrics.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/800xos1k9x40le8u8b2d.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jwtyoiyfclc73jle1dby.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y7ihagrj8zxhctf45j11.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xntheqlfk94oy5hh1q8o.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gae3ctg9t1n8ok1kg99v.jpg)

If you are interested, I published a book with all the sketchnotes on Istio (and new ones!): ["Understanding Istio in a visual way"](https://gumroad.com/aurelievache#vJYhM).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Road to Genius: advanced #43
Tags: javascript, beginners, codenewbie, computerscience
Published: 2020-07-08 06:01:41

Each day I solve several coding challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, and you will learn a ton of new and interesting things as you go.

```JS
function RPN(tokens) {
  const stack = [];
  for (let index = 0; index < tokens.length; index++) {
    const token = tokens[index];
    if (!Number.isNaN(Number(token))) {
      stack.push(token);
    } else {
      const a = Number(stack.pop());
      const b = Number(stack.pop());
      if (token === '*') {
        stack.push(b * a);
      } else if (token === '/') {
        stack.push(b / a);
      } else if (token === '+') {
        stack.push(b + a);
      } else if (token === 🍎) {
        stack.push(b - a);
      }
    }
  }
  return stack.pop();
}
let arr = ['5', '4', '1', '2', '+', '7', '*', '/', '*', '2', '+', '4', '+'];
let A = RPN(arr);
A = Math.floor(A);

// 🍎 = ? (string)
// such that A = 6 (number)
```

Here's an interesting challenge where we only have to fix one bug 🍎. It's an easy challenge. To solve it we have to look at the environment surrounding the bug:
```JS
if (token === '*') {
  stack.push(b * a);
} else if (token === '/') {
  stack.push(b / a);
} else if (token === '+') {
  stack.push(b + a);
} else if (token === 🍎) {
  stack.push(b - a);
}
```
Notice that the token is some string that represents an operation (*, /, + and 🍎), the push operation below it reveals its actual operation, so 🍎 has to be `-`.

![coding challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/0p34mqauhv7d1uwm5idp.png)

A bit more info about this code; The function `RPN` stands for Reverse Polish Notation, it's a way of representing a series of mathematical operations to be computed. You can Google it for more details, since we might encounter it again later I'll leave it at this.

By solving these challenges you train yourself to be a better programmer. You'll learn newer and better ways of analyzing, debugging and improving code. As a result you'll be more productive and valuable in business. Get started and become a certified Codr today at https://nevolin.be/codr/
DangerJS with Github Actions
Tags: dangerjs, github, ci
Published: 2020-07-07 23:16:12

---
title: DangerJS with Github Actions
published: true
description: 
tags: dangerjs, github, CI
---

Have you ever had to comment on a PR 'Hey, you forgot to...' before? If so, [DangerJS](https://github.com/danger/danger-js) might be a good tool to add to your PR checks. I decided to give it a try at work after doing that myself a couple of times.

Note: Danger has plugins for Ruby, Python and Swift that you can use. But if you don't trust on using external images for your projects, you can follow this approach.

I really struggled with this part and the documentation wasn't so great. That's why I decided to share my experience. Hope you enjoy it!

## Setup

First, you will need to create a Github action build file. Github Actions need to be placed in a `workflow` folder. [Click here](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#creating-a-workflow-file) for more info about that.

```yaml
name: Danger checks 🚧

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: "12.x"
      - name: Install yarn dependencies
        run: |
          yarn add danger --dev
          yarn danger init
          yarn danger ci --dangerfile ..your-repository/dangerfile.js
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

- I am using a node Docker image to install yarn. Then I use yarn to run Danger.
- Keep in mind that you need to add the `GITHUB_TOKEN` here, otherwise Danger won't comment your PR's.
- It also won't comment if you just use `push` action to trigger this build. Danger is designed to only comment on a `pull_request`.

Now you just need to create your `dangerfile.js` in your directory. This is where you will add your checks. To test it, you can just comment a nice message:

```jsx
import { danger, message, warn, fail } from "danger";

const your_file = danger.git.fileMatch("your_file_path")

if (your_file.edited) {
  message("Please write a data migration to run the changes")
}
```

And that's it! You should have a new check on your Github Pull requests and a nice message on your PR.

Click [here](https://danger.systems/js/guides/getting_started.html#creating-a-dangerfile) for more examples on how Dangerfile works.

### Nice-to-do

- Use just `pull request` action. Ideally this build would just need `pull_request` to detect new changes automatically?
- Danger wasn't getting my dangerfile automatically so I had to pass my file path in the `yarn danger run` command. Maybe I was having another error and this is now working, but that's for later!

After putting some puzzles together, I have Danger setup now and hopefully you too. Let me know if you have any tips or feedback!
Build a Tinder Clone with Flutter, Firebase and Bloc part 1/40 Tips on this series
Tags: flutter, tutorial, dart, career
Published: 2020-07-08 05:36:13

---
title: Build a Tinder Clone with Flutter, Firebase and Bloc part 1/40 Tips on this series
published: true
description: Tutorial on building a Tinder clone with Flutter, Firebase and Bloc
tags: #Flutter #Tutorial #dart #career
//cover_image: https://direct_url_to_image.jpg
---

Hi good people. 

In this series of **videos** we are going to build a Tinder clone build Flutter, Firebase as a backend and Bloc as our state management solution.

In this video I talk of some of the challenges encountered while building the app due to Flutter stable version upgrading and affecting the packages used. Also how incompatibility issues were solved.  

Protip: Watch video at **1.25** speed. 



{% youtube bf4vDsTtfEc %}
Weekly web development update #33
Tags: webdev, weekly
Published: 2020-07-08 05:13:16

Here's the new weekly update :)


______

##[hyperapp](https://hyperapp.dev/)
[![hyperapp](https://hyperapp.dev/card.b7cfd6ff.png)](https://hyperapp.dev/)
A tiny framework for building functional, declarative web interfaces.

______

##[html.systems](http://html.systems/)
[![html.systems](https://wweb.dev/weekly/screenshots/html-systems.jpg)](http://html.systems/)
A set of components built with HTML, CSS and JavaScript.

______

##[Knopf.css](https://knopf.dev/)
[![Knopf.css](https://knopf.dev/banner.jpeg)](https://knopf.dev/)
A CSS library for modular, extensible button system.

______

##[Tailwind cheat sheet](https://nerdcave.com/tailwind-cheat-sheet)
[![Tailwind cheat sheet](https://wweb.dev/weekly/screenshots/tailwind-cheatsheet.jpg)](https://nerdcave.com/tailwind-cheat-sheet)
A cheat sheet that provides an interactive reference for utility classes and CSS properties provided by Tailwind CSS.

______

##[shareon](https://shareon.js.org/)
[![shareon](https://wweb.dev/weekly/screenshots/shareon.jpg)](https://shareon.js.org/)
A JavaScript and CSS library for share buttons of all popular social networks.

______

##[DecentDrops](https://decentdrops.com/)
[![DecentDrops](https://dpkqkssmbsv3o.cloudfront.net/social.png)](https://decentdrops.com/)
A list of recently expired domain names, which are brandable and pronounceable.

______

##[Screenshot.Rocks](https://screenshot.rocks/)
[![Screenshot.Rocks](https://wweb.dev/weekly/screenshots/screenshot-rocks.jpg)](https://screenshot.rocks/)
A nice tool to create browser mockups in seconds.

______

##[ahooks](https://ahooks.js.org/)
[![ahooks](https://wweb.dev/weekly/screenshots/ahooks.jpg)](https://ahooks.js.org/)
A library with large set of React Hooks with demos and examples.

______

##[Sign-in form best practices](https://web.dev/sign-in-form-best-practices/)
[![Sign-in form best practices](https://wweb.dev/weekly/screenshots/signin-best-practices.jpg)](https://web.dev/sign-in-form-best-practices/)
A good read by Sam Dutton about the best practices for login forms, including a checklist.

______

##[Rotated Revealer Effect](https://tympanus.net/Tutorials/RotatedRevealers/)
[![Rotated Revealer Effect](https://codropspz-tympanus.netdna-ssl.com/codrops/wp-content/uploads/2019/04/Revealers_featured.jpg)](https://tympanus.net/Tutorials/RotatedRevealers/)
A set of rotated reveal and overlay effects for page transitions by Codrops.

______

##[Profiled](https://profiled.app/)
[![Profiled](https://d3rt40l602b866.cloudfront.net/uploads/Profiled-sample-vanessa-ramirez.png)](https://profiled.app/)
An App, that generates a portfolio from the info in your GitHub account.

______

##[Linear](https://linear.app/)
[![Linear](https://linear.app/static/metaImage4.jpg)](https://linear.app/)
An issue tracking tool to streamline software projects, sprints, tasks, and bug tracking.

______

To see all the weeklies check: [wweb.dev/weekly](https://wweb.dev/weekly)
Integrate a CRM Application with Alexa using AWS Lambda
Tags: aws, python, serverless, crm
Published: 2020-07-08 04:27:08

I have been configuring and customizing CRM applications for my whole professional career. So from the day I learnt about AWS lambda and how it can be used with an Alexa skill, I have planning to Alexa-enable a CRM application.Last week I completed my side project and developed an Alexa skill to integrate Salesforce(SFDC) application with Alexa. I am still refining the functionality to make it more secure and user friendly but meanwhile I will be able to write some posts describing my integration solution.Though this example is based on SFDC, it can easily be extended to any other CRM applications too like Oracle Sales cloud, Microsoft Dynamics CRM etc. As long as there is a REST API interface for the CRM app, with a little change this solution can be re-used.

This will be a series of multiple posts because there are multiple components involved and I can’t fit them in one post. So bear with me as I go through, what I built and how I built it.

The posts can be found on my blog:  

## Part1
https://amlanscloud.com/alexa-crm-integration/  

## Part 2
https://amlanscloud.com/alexa-crm-integration-2/
Why we open sourced our web framework
Tags: payments, adyen, opensource, github
Published: 2020-07-08 04:12:12

_By Marc Pérez i Ribas, Front-end developer, Adyen_

We are excited to announce that we are open sourcing our front-end library, [Adyen Web](https://github.com/Adyen/adyen-web). Our library offers a complete UI solution to collect shopper information using our [Drop-in](https://docs.adyen.com/checkout/drop-in-web) and [Components](https://docs.adyen.com/checkout/components-web) integrations, which handle all shopper interactions during checkout.

From our [server-side libraries](https://docs.adyen.com/development-resources/libraries), our [plugins](https://docs.adyen.com/plugins), and [OpenAPI definitions](https://github.com/Adyen/adyen-openapi) - our team is committed to open source. Adyen Web has been developed internally for over a year now, and at this stage, we want to further our merchants’ experience by showing what goes on under the hood. In the end, opening our development to the community allows Adyen Web to be more secure, flexible, and transparent.

##Increased visibility
One of our goals is to make it easier for our merchants to keep track of releases and to see what we are preparing for the next versions of our web library. In addition, merchants can see the exact code that is running on their checkout page - which simplifies both the integration process as well as the debugging process in the event any issues arise.

##Community-oriented
Our developer community is a great source of feedback and ideas for our integrations. By opening up Adyen Web, we now have a new place to discuss feedback, new ideas, or bug fixes in the form of [GitHub Issues](https://github.com/Adyen/adyen-web/issues). We are also open to Pull Requests for direct collaboration, which allows any developer to contribute to our source code.

##Infrastructure
By publishing our source code on GitHub, we can also leverage all their excellent tools for collaboration and continuous integration. We have now integrations that can run tests, look at code quality and security issues on every code change, and even publish a package to [npm](https://www.npmjs.com/package/@adyen/adyen-web).

##Getting started
We are excited to work with you to build the future of Adyen Web! Feel free to explore our [repository](https://github.com/Adyen/adyen-web) to get started.

- Found an issue? [Create a new Issue on GitHub](https://github.com/Adyen/adyen-web/issues).
- Would you like to contribute? [See our contribution guidelines](https://github.com/Adyen/.github/blob/master/CONTRIBUTING.md).
- Learn how to [start accepting payments with Adyen Web](https://docs.adyen.com/checkout).
- Check out [all our open source repositories on GitHub](https://github.com/Adyen).

> ##_Technical careers at Adyen_
_We are on the lookout for talented engineers and technical people to help us build the infrastructure of global commerce!_
_[Check out developer vacancies](https://www.adyen.com/careers/vacancies/development)_

> ##_Developer newsletter_
_Get updated on new blog posts and other developer news._
_[Subscribe](https://www.adyen.com/newsletter/developers)_
Can NullPointerException be helpful?
Tags: java, exception, productivity
Published: 2020-07-08 04:07:31

### ***Have you ever received NullPointerException ?***
Every Java developer has encountered NullPointerExceptions, this is most common programming error new Java Developers face.

Following is one simple programming mistake, I am trying to call method size on null list.

```java
public class NullPointerExceptionDemo {
    public static void main(String[] args) {
        List<Integer> list = null;
        System.out.println(list.size());
    }
}
```

This is output of running NullPointerExceptionDemo

```
Exception in thread "main" java.lang.NullPointerException
at com.vip.jdk14.NullPointerExceptionDemo.main(NullPointerExceptionDemo.java:8)

Process finished with exit code 1
```

In above example it is clear list is null but several other situation it is not easy to understand root cause. See following example.

```java
    System.out.println(objectA.getObjectB().getObjectC().getObjectD());
```
Here you may get NullPointerException, when ***objectA*** or ***objectA.getObjectB()*** or ***objectA.getObjectB().getObjectC()*** any of them is null. And you get same NullPointerException message in all these cases.

<br>

### ***Java 14 can show you root cause of NullPointerException***

Now Java 14 has added language feature to show root cause of NullPointerException.
This language feature has been part of [SAP](https://twitter.com/SweetSapMachine) commercial JVM since 2006.


<br>

### ***Helpful NullPointerException***

In Java 14 you can start passing -XX:+ShowCodeDetailsInExceptionMessages in VM arguments and it helps you to see root cause of NullPointerException.
In Java 14 option is disabled by default and in later releases this will be enabled by default.

```java
public class HelpfulNullPointerExceptionDemo {
    public static void main(String[] args) {
        List<Integer> list = null;
        System.out.println(list.size());
    }
}
```
Running this program prints following Exception message, and root cause is clearly written ***list is null***.

```
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "list" is null
at com.vip.jdk14.HelpfulNullPointerExceptionDemo.main(HelpfulNullPointerExceptionDemo.java:8)

Process finished with exit code 1
```

<br>

### ***At the end***

To learn the best java language features and get the best Java Jobs, download my ebook [5 steps to Best Java Jobs](https://jfeatures.com/) for Free.

Follow me on twitter [@vipinbit](https://twitter.com/vipinbit) to get daily tips like this on Java Language Features.
Tired of Entity Framework Syncing Issues with Multiple Developers Creating Migrations?
Published: 2020-07-08 03:45:51

We found this article the other day which addresses how to resolve issues when Entity Framework has syncing issues with multiple developers creating migrations at the same time.  Its so good and useful it would be a shame not to share.

Do read it all and do go for the re scaffold option rather than the crude blank migration option.

https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/teams
Day 37 : #100DaysofCode - 30 seconds of code
Published: 2020-07-08 02:58:01

Today I finished the entire <a href="https://www.hackerrank.com/domains/ruby?filters%5Bstatus%5D%5B%5D=unsolved&badge_type=ruby"> HackerRank Ruby</a> section and I started reviewing css on the <a href="https://www.30secondsofcode.org/css/p/1"> 30 seconds of code </a> website. 

As I continue to practice coding, I realize that there are so many different resources to learn code. For someone like me, that sucks because there are only 24 hours a day and I want to learn it all. 

However, I was reading advice for future/aspiring software engineers and all of them say the same thing. . . conquer one language at a time. So today I wrote down a list of the top 5 languages I want to "conquer."

1. Ruby
2. HTML/CSS
3. Python
4. Javascript
5. PHP

I know that is a lot, but I know I can do it. Plus, once you know one language you pretty much know them all, just need to learn the different syntaxes. So as I learn, I want to build applications using each of the languages listed above. I look forward to learning and building my portfolio and sharing what I learn along the way. 

Song of the day

{% youtube SMpMLTpEXVk %}
Labeled Breakout & GOTO
Tags: healthydebate, watercooler, twitterverse
Published: 2020-07-08 02:49:28

So I saw a post on Twitter, talking about labeled breaks... Which led to people fervently recommending not to do such patterns. Somehow this brought up GOTO, now this is the thing, I have never used GOTO, I Googled it. What I read was likely the correlation to the heavy abuse of GOTO in multi-loop breaks since the example was nested for loops using labeled breaks. 

From what I can tell, which is limited. The GOTO was essentially abstracted away by such things as `for`, `while`, `switch`, `do`, and the like. Reintroducing the GOTO paradigm seems redundant in structured programming. 

My naive thought about this is in a modern high-level language there is probably a builtin model that is optimized that does something similar. However, I brought it up here because I want to learn more about it and GOTO beyond some old code and Wikipedia.