version: 2.1
executors:
  test-go121:
    docker:
      - image: "cimg/go:1.21"
    environment:
      runrace: true
      TIMESCALE_FACTOR: 3
 
jobs:
  "test": &test
    executor: test-go121
    steps:
      - checkout
      - run:
          name: "Build infos"
          command: go version
      - run:
          name: "Run tools tests"
          command: go run github.com/onsi/ginkgo/v2/ginkgo -race -r -v -randomize-all -trace integrationtests/tools
      - run:
          name: "Run self integration tests"
          command: go run github.com/onsi/ginkgo/v2/ginkgo -v -randomize-all -trace integrationtests/self
      - run:
          name: "Run version negotiation tests"
          command: go run github.com/onsi/ginkgo/v2/ginkgo -v -randomize-all -trace integrationtests/versionnegotiation
      - run:
          name: "Run self integration tests with race detector"
          command: go run github.com/onsi/ginkgo/v2/ginkgo -race -v -randomize-all -trace integrationtests/self
      - run:
          name: "Run self integration tests with qlog"
          command: go run github.com/onsi/ginkgo/v2/ginkgo -v -randomize-all -trace integrationtests/self -- -qlog
      - run:
          name: "Run version negotiation tests with qlog"
          command: go run github.com/onsi/ginkgo/v2/ginkgo -v -randomize-all -trace integrationtests/versionnegotiation -- -qlog
  go121:
    <<: *test

workflows:
  workflow:
    jobs:
      - go121
