GithubHelp home page GithubHelp logo

isabella232 / k6-intellij-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grafana/k6-intellij-plugin

0.0 0.0 0.0 1.23 MB

Brings k6 to your favorite IDE!

Home Page: https://plugins.jetbrains.com/plugin/16141-k6

License: Apache License 2.0

Kotlin 90.23% JavaScript 9.77%

k6-intellij-plugin's Introduction

⚠ ️ This project is no longer maintained in this repository.

Development and maintenance have been stopped in this repository.

A fork of this project is active and maintained at mbolotov/k6-intellij-plugin.

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

k6-intellij-plugin's People

Contributors

mbolotov avatar ppcano avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.