A
A
Alexander Vladimirovich2020-02-26 14:45:39
go
Alexander Vladimirovich, 2020-02-26 14:45:39

How to run integration tests in a given order?

Greetings!

There is a test that needs to be executed in order, first Create (get an ID from it) then Read using the received ID, and so on.
How to do it?

package integration

import (
  "context"
  "testing"
  ...

func TestCreate(t *testing.T) {
...
}

func TestRead(t *testing.T) {
...
}

func TestUpdate(t *testing.T) {
...
}

func TestDelete(t *testing.T) {
...
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Sviridov, 2020-02-26
@polyanin

It's not right to do so. Tests should not depend on each other.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question