question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST] Control order in which Unit tests are executed

See original GitHub issue

Describe the bug I have multiple unit tests in a test suite and these need to be in a certain order, so have information available in the next request. When I execute this with the cli tool, this doesn’t follow the order from the GUI.

I know in theory unit tests shouldn’t depend on each other, but with the current way of running multiple requests, you have no clear view which requests are bering executed due to the use of the name.

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘Test’
  2. Create a new test suite
  3. Create 4 or 5 tests with a incrementing number in it’s name
  4. Execute the test-suite
  5. See different order of unit tests

Expected behavior The order with the CLI should be the same as in the GUI.

Screenshots

  General
    ✓ Returns 200 (1585ms)
    1) Returns 200
    ✓ Returns 201 (305ms)
    2) Returns 200


  2 passing (2s)
  2 failing

  1) General
       Returns 200:
     Error: No responses for request

  2) General
       Returns 200:
     Error: No responses for request

The third test (201) should have run second.

Desktop (please complete the following information):

  • OS: macOS 10.15.6
  • Installation Method: dmg and yarn
  • App Version: 2020.3.3 and 2.2.22

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
palevi67commented, Nov 4, 2021

To me it would be a great if:

1.- Insomnia-cli run tests sequentially and in a known order (as insomnia now do) 2.- Insomnia allows to manually reorder tests

This would make test configuration much simpler, reducing the need to deal with javascript code and obscure request ids.

Maybe what insomnia calls “test” could be renamed to “test step” or “api call” or something similar, and what insomnia calls “test suite” could be renamed simply a “test” … what do you think?

0reactions
Neko-Designcommented, Aug 29, 2022

Hey All, this one is a critical one for my current case as well, where we have an ordered flow to validate each step of an onboarding api, something like:

  1. Create Account
  2. Send validation email
  3. Update Account
  4. List account resources
  5. Delete account

Where each call needs to be made in sequence as running the steps out of order wouldn’t work, so we need guaranteed ordering in some way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controlling execution order of unit tests in Visual Studio
An orderedtest a text file that lists your tests in the order they should be executed. · The test execution order is respected...
Read more >
Order unit tests - .NET - Microsoft Learn
With MSTest, tests are automatically ordered by their test name. Note. A test named Test14 will run before Test2 even though the number...
Read more >
xUnit: Control the Test Execution Order - Hamid Mosalla
In this post I'm going to discuss how we can control the Test Execution Order using xUnit framework by using ITestCollectionOrderer and ...
Read more >
JUnit Test Execution Order: Order Of Tests JUnit 4 Vs JUnit 5
The test methods don't follow a specific order by default. The test cases need not necessarily execute in the order in which they...
Read more >
The Order of Tests in JUnit - Baeldung
In JUnit 5, we can use @TestMethodOrder to control the execution order of tests. We can use our own MethodOrderer, as we'll see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found