Run Details View: Build Insights for Nx on Nx Cloud
Tags: nx, buildtool, codesharing, devops
Published: 2020-09-25 15:00:12

{% youtube iGpwcNuYtlY %}

_Learn about Run Details View in Nx Cloud in less than 5 minutes — [https://youtu.be/iGpwcNuYtlY](https://youtu.be/iGpwcNuYtlY)_

## Somewhere on a remote team far, far away…

>👨🏼‍💻 “Hey, I’ve got failing tests locally again :(”
>👩🏾‍💻 “Which ones?”
>👨🏼‍💻 “Uh…I’m not actually sure yet, I was running nx affected:test and it ended up testing all of the UI projects.”
>👩🏾‍💻 “Can you show me?”
>👨🏼‍💻 “Oh no…I’ve lost the command line output. My terminal buffer wasn’t big enough. I guess I’ll need to run the failed projects again.”
>👩🏾‍💻 “Ok. Just give me a ping when you’re ready.”
>👨🏼‍💻 “Sure. This might take a while…”

Running tests against lots of projects can be a problem even in a relatively small monorepo. Your command line output could be thousands of lines long and this can be a nightmare to sift through when looking for the output of that one failing project and the tests that caused the entire run to fail. There has to be a better way.

In CI/CD systems there is often a way to drill into the various runs that happen while testing the integrity of the latest pull request or merge into the main branch, but what about locally? Wouldn’t it be great if I could view that output in a better way and even share that with a colleague so we can get right into fixing the problem rather than trying to find it?

## Connect to Nx Cloud!

>👩🏾‍💻 “I’ve had an idea, why don’t we connect our repo to the Nx Cloud app?”
>👨🏼‍💻 “How do I do that?”

We’ve added a new argument, `--scan`, that you can pass to any nx command. It will prompt you to connect to our [Nx Cloud](https://nx.app) platform if necessary and then not only will you benefit from our free tier of compute caching but we will also log the output of that run and provide you a place to explore and share it!

Say I want to run the test targets in all the projects:

![Terminal output to connect to Nx Cloud for free](https://miro.medium.com/max/1400/0*SpP6yniAsMKvCbPW.png)

After completing the run you’ll see a message that gives you a URL where you can view your run details.

![Nx Cloud terminal output: see run details link](https://miro.medium.com/max/1400/0*U3HHI0DxGBiDaU7x.png)

## 👀 Run Details View

Following that URL will take you to the brand new Run Details view.

![Nx Cloud run details view](https://miro.medium.com/max/1400/0*ozN-5mrFviTMZ7_A.png)

At the top you can see summary information about the run itself: how long it took, how many tasks failed and even some information about the machine that executed the run. Below all that are the executed tasks themselves, in this case each will be the execution of the test target against an individual project.

## ✅ Simple Filtering

You can see at a glance the execution time of each task, whether it was a success or failure and even whether or not it was a cache hit or miss, but there might be too many to visually deal with. The project filter and toggles at the top allow you to reduce the tasks to only the ones you need to focus on.

![Nx Cloud run details filtering options](https://miro.medium.com/max/1400/0*pg1oEzcPSJWL8J_R.png)

Once you’ve found the project you need, you can expand the view to dig into the command line output itself.

![Run Details command line output details](https://miro.medium.com/max/1400/1*YQlB6R01p0N4QzBECzV2yg.png)

## 🔒 Access Control

>👨🏼‍💻 “This is great, but should we really leave these open to anyone?”
>👩🏾‍💻 “Let’s set up an organisation…”

If you’ve never connected your monorepo to Nx Cloud before the run detail view will be available to anyone with the unique url, so you can share that immediately. However, you’ll also see a message at the top of the page informing you that the workspace is currently public.

![Claim your workspace prompt on Nx Cloud](https://miro.medium.com/max/1400/0*RAmuw79NdFu6AvLf.png)

Claiming the workspace connects it to your Nx Cloud account and allows you to limit access to only those in your organisation.

![Claim Workspace page on Nx Cloud prompting for access token](https://miro.medium.com/max/1400/0*3LE0zkxMLT1UbY0x.png)

To access the run detail view from a claimed workspace you will need an Nx Cloud account. Workspace owners can easily invite members to collaborate in their organisation.

![Invite members to Nx Cloud workspace](https://miro.medium.com/max/1400/0*I9-9mSCv5pxxxuQ6.png)

## 🤝 Simpler Investigation & Collaboration

One you’ve connected your monorepo to Nx Cloud we will provide unique urls to view each run that anyone working in the repository makes against it. We won’t record the command line output for every run unless you provide the `--scan` argument each time, but if you’re sure you want to do this for every run, you can add `"scan" : true` to the `tasksRunnerOptions` in `nx.json` at the root of the repository.

>👨🏼‍💻 “Amazing, but what about all the runs that happen on each PR?”
>👩🏾‍💻 “I think there’s an app for that…”

## 🤖 GitHub Integration

You can integrate our new [Nx Cloud companion app](https://github.com/apps/nx-cloud) into your GitHub repos and get a full report in your pull requests including links to each of the runs performed against them. You can see a full report from a recent pull request into our public [Nx GitHub repository](https://github.com/nrwl/nx) below.

![Nx Cloud bot on GitHubNx Cloud bot on GitHub](https://miro.medium.com/max/1400/0*wDqi1_T17xYyS-sM.png)

We use Nx Cloud on all our repositories at [Nrwl](https://nrwl.io) and we’ve already found it extremely useful for investigating runs with a lot of output and when collaborating remotely. We hope you find it useful too!

## 👋 Epilogue

>👨🏼‍💻 “Hey, I’ve got failing tests again. Here’s the run detail — https://nx.app/runs/…”
>👩🏾‍💻 “Thanks! Oh, I see which test it is. I think I know what might be the problem. Do you want to jump on a call and we can fix this now?”
>👨🏼‍💻 “Sure, let’s go!”

![Nx Cloud](https://dev-to-uploads.s3.amazonaws.com/i/d0lfozs0i46sgh22gptr.png)

_Run Details View is available now for free with [Nx dev tools](https://nx.dev) on [Nx Cloud](https://nx.app)._

---

**Author:** Jo Hanna Pearce, [@jdpearce](https://twitter.com/jdpearce)
**Video:** Rareș Matei, [@__rares](https://twitter.com/__rares)