K6-intellij-plugin - IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your IntelliJ IDE

Overview

IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your IntelliJ IDE.

  • Run a k6 test as a Run configuration (a common way to run something withing IntelliJ platform)
  • Run a k6 test using keyboard shortcuts.
  • Run a k6 test from the search Menu.
  • Run a k6 test from the popup file menu.
  • Visualize the k6 results in the Run tool window.

How it works

This plugin allows running a k6 test in the 4 different ways:

Run the test as a Run configuration.

A k6 run configuration can be created in several ways:

  • By clicking on a green run gutter near the default function in the editor: img.png
  • Via the context menu of a k6 test file
  • Using the Run/Debug Configurations dialog window

Once a run configuration is created, it can be used multiple times to execute the test.

Beside the test path itself, a run configuration can define some other properties to be used to execute the test:

  • Local/Cloud run type selection
  • Additional CLI parameters, like --vus 10
  • Additional environmental variables
  • Define whether to show each threshold as a separate test in the test console by selecting the Show thresholds as tests checkbox

Default values for each of the properties can be defined via a Run configuration template.

Run the test from the popup file menu.

Select the test file, open the file options and click on k6: run current file or k6: run current file in k6 cloud.

k6 Cloud File Options

Run the test from the Search Menu.

From the main menu, select Navigate | Search Everywhere or press Shift twice to open the search window. Search for k6 and trigger k6: run current file or k6: run current file in k6 cloud.

k6 Search Commands

Run the test using keyboard shortcuts.

By default, Alt+K for running local tests, and Alt+Shift+K for cloud tests.

k6 Shortcuts

When IntelliJ IDEA runs a k6 test, the Run tool window will display the test results generated by k6.

k6 Output

For running cloud tests, set your k6 Cloud Token in Settings/Preferences/Tools/k6.

k6 Cloud Token

Run a test written in TypeScript

k6 does not support running a typescript test directly. To execute both build task and run test actions in one click you can define a Run configuration to run your compiled js test and to execute a npm build script before launch:

img.png

Show thresholds as tests

When Show thresholds as tests checkbox is selected in a run configuration, the plugin will display each configured threshold as a passed or failed test inside the test console tree view:

thresholds as tests Each of the threshold entry is clickable and navigates to the threshold source element by double click (or key shortcut). Under the hood, the plugin utilises handleSummary callback to collect the test execution results, so it has to wrap original script and proxy the calls.

Installation

  • In the Settings/Preferences dialog, select Plugins.
  • Use the Marketplace tab to find the k6 plugin.
  • Click install.
  • Enjoy!

Build plugin from the sources

./gradlew buildPlugin

Install plugin from local file system via the following menu item: img.png

Start IDE bundled with plugin via gradle:

./gradlew runIde
You might also like...
IntelliJ-based IDEs Protobuf Language Plugin that provides Protobuf language support.
IntelliJ-based IDEs Protobuf Language Plugin that provides Protobuf language support.

IntelliJ Protobuf Language Plugin Reference Inspired by protobuf-jetbrains-plugin and intellij-protobuf-editor. Descriptor IntelliJ-based IDEs Protobu

Plugin for IntelliJ-based IDEs folding root files in the ProjectView
Plugin for IntelliJ-based IDEs folding root files in the ProjectView

Foldable ProjectView The Foldable ProjectView is a plugin for the IntelliJ-based IDEs that lets you fold files located in the root of your project. Av

Kotlin Multiplatform (pending KSP support) snapshot (klip) manager for tests

KLIP Kotlin Multiplatform (pending KSP support) snapshot (klip) manager for tests Modules core - runtime library processor - ksp-based annotation proc

A tool to convert unit tests from one standard to another

unit-test-exchange-maven-plugin This plugin works as a tool to convert unit test

A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

A solution to fix obfuscated Java services after ProGuard has run

ProGuard Service Mapper This is a service mapper for the ProGuard Java bytecode

An Android Studio / IntelliJ plug-in help you upload your apk or listing to Google Play.

DroidLane An Android Studio / IntelliJ plug-in help you upload your apk or listing to Google Play. Installation Open Android Studio or IntelliJ IDEA O

A Gradle plugin for providing your secrets to your Android project.

Secrets Gradle Plugin for Android A Gradle plugin for providing your secrets securely to your Android project. This Gradle plugin reads secrets from a

Comments
  • Support relative script path in run configuration

    Support relative script path in run configuration

    k6 Script path UI field in a run configuration should support a path relative to the project root. image

    Original issue: https://github.com/grafana/k6-intellij-plugin/issues/12

    opened by mbolotov 0
  • Support K6' modules

    Support K6' modules

    Whenever I do foo = http.post(...), IntelliJ complains that http.post is not returning a value and that that's probably an error. The tooltip refers to a Session.http function, which I suspect is from NodeJS; anyway, it has a completely different signature than K6' Session.

    opened by toolforger 1
Owner
Mikhail Bolotov
Mikhail Bolotov
Leader key for IntelliJ-based IDE's. Now IdeaVim-friendly!

Ataman Ataman - an elected leader of the Cossack troops and settlements Ataman is an Intellij Idea plugin for using leader key for bindings (almost li

Mikhail Levchenko 50 Dec 13, 2022
✈️ IDE plugin for the IntelliJ platform which adds GitHub Copilot support. (VERY WIP)

JetBrains Copilot GitHub Copilot support for the IntellIJ Platform. Installation Download the latest release. Select the Install Plugin from Disk opti

Koding 155 Dec 10, 2022
A plugin for Jetbrains IDE, Your code is powerful, unleash it like playing osu!

Osu! Mode A plugin for Jetbrains IDE, Your code is powerful, unleash it like playing osu! Demo 2021-10-15.18-50-30.mp4 Bilibili Feature open project /

Nthily 8 Sep 8, 2022
Manage pull requests and conduct code reviews in your IDE with full source-tree context.

String Manipulation IntelliJ plugin - https://plugins.jetbrains.com/plugin/2162 Sponsored by Manage pull requests and conduct code reviews in your IDE

Vojtěch Krása 582 Dec 22, 2022
This plugin allows creating or editing Excalidraw virtual whiteboard within the IDE.

Excalidraw Integration for Jetbrains IDEs This plugin allows creating or editing Excalidraw virtual whiteboard within the IDE. Installation Using IDE

Brice Dutheil 46 Dec 11, 2022
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
Provides a shortcut to copy permalink in their online Git repositories from inside IDE.

Copy Git Link Provides a shortcut to copy permalink in their online Git repositories from inside IDE. Works with: GitHub GitLab Bitbucket My.Movie.4.3

ryo 13 Jan 3, 2023
An IDE plug-in for quick access to Jetpack Compose controls

An IDE plug-in for quick access to Jetpack Compose controls

Jetpack Compose Museum 17 Aug 28, 2022
Kirill Rakhman 4 Sep 15, 2022