kudobuilder / kudobuilder/kuttl

Paths in Kuttl TestSuite should be relative to the TestSuite File

Open
#89 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

info-needed
Dominant language
Go
Stars
824
Forks
103
Avg merge
1d 11h
Merged PRs (30d)
6

Description

**What happened**:
I have a Kuttl Test Suite File:
```
apiVersion: kudo.dev/v1alpha1
kind: TestSuite
manifestDirs:
- ../manifests/
commands:
- command: ../bin/kubectl-kudo init
testDirs:
- ./common
```

This file is located in a folder structure:
```
.
├── bin
│   ├── kubectl-kudo_0.12.0
│   ├── kubectl_1.17.2
├── manifests
│   └── local-path-storage.yaml
└── suites
├── common
│   ├── install-test
│   │   ├── 00-assert.yaml
│   │   ├── 00-install.yaml
│   │   ├── params.yaml
│   │   └── params.yaml.template
│   └── kind-config.yaml
├── kuttl-common.yaml
```

When calling kuttl from a different directory, the manifests, binaries and testDirs are not found because they are looked up relative to the current working directory of the caller.

**What you expected to happen**:
Paths inside a TestSuite file should be relative to that file, not the current working directory of the caller.

**How to reproduce it (as minimally and precisely as possible)**:
Call kuttl with a TestSuite file from another directory.

**Environment**:
- KUTTL version (use `kubectl kuttl version`): 0.2.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the TestSuite file-loading and path-resolution entry point, then reproduce the reported invocation from a directory other than the suite's directory. Check how manifestDirs, commands, and testDirs are resolved; done means all three paths resolve relative to the TestSuite file rather than the caller's working directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.