Skip to content
Permalink
Browse files

Remove TDD docs, add more info on running tests (#2335)

**What kind of PR is this?**

/kind docs

**What does does this PR do / why we need it**:

- Removes TDD documentation which is outdated / we no longer use it.
- Adds documentation on how to run a single test

**Which issue(s) this PR fixes**:

Fixes #2295

**How to test changes / Special notes to the reviewer**:

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
  • Loading branch information...
cdrage authored and openshift-merge-robot committed Nov 7, 2019
1 parent b14cd3a commit 70c5a6f4812197c60efef5c4eeadb86c5f0d11a2
Showing with 15 additions and 63 deletions.
  1. +15 −5 docs/dev/development.adoc
  2. +0 −58 docs/dev/tdd-workflow.adoc
@@ -80,19 +80,20 @@ $ git remote set-url --push upstream no_push

=== About Prow
`odo` uses the link:https://github.com/kubernetes/test-infra/tree/master/prow[Prow] infrastucture for CI testing.

* It uses link:https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md[OWNERS] files to determine who can approve and lgtm a PR.
* Prow has two levels of OWNERS, *Approvers* and *Reviewers*
** *Approvers* look for holistic acceptance criteria, including
dependencies with other features, forward and backward compatibility, API and flag definitions, etc. In essence, the high levels of design
** *Reviewers* look for general code quality, correctness, sane software engineering, style, etc. In essence, the quality of the actual code itself.

* Avoid merging the PR manually, unless it is an emergency and you have the required permissions). Prow’s tide component automatically merges the PR once all the conditions are met.
* Avoid merging the PR manually (unless it is an emergency and you have the required permissions). Prow’s tide component automatically merges the PR once all the conditions are met.
It also ensures that post-submit tests (tests that run before merge) validate the PR.
* Use the link:https://deck-ci.svc.ci.openshift.org/command-help[command-help] to see the list of possible bot commands.

== Test Driven Development
== Tests

We follow the Test Driven Development(TDD) workflow in our development process. You can read more about it link:tdd-workflow.adoc[here].
We use unit, integration and e2e (End to end) tests.

=== Unit tests

@@ -101,7 +102,7 @@ https://godoc.org/k8s.io/client-go/kubernetes/fake[fake]. This allows us to crea

The tests are written in golang using the https://golang.org/pkg/testing/[pkg/testing] package.

==== Writing unit tests
==== Writing unit tests using the fake Kubernetes client

. Identify the APIs used by the function to be tested.
. Initialize the fake client along with the relevant client sets.
@@ -181,7 +182,16 @@ $ MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags "--ena

*Integration tests:*

Integration tests utilize link:https://github.com/onsi/ginkgo[`Ginkgo`] and it's preferred matcher library link:https://github.com/onsi/gomega[`Gomega`] which define sets of test cases (spec). As per ginkgo test file comprises specs and these test file are controlled by test suite. Test and test suite files are located in `tests/integration` directory and can be called using `.PHONY` within `makefile`. Integration tests validates and focuses on specific fields of odo functionality or individual commands. For example, `cmd_app_test.go` or `generic_test.go`.
Integration tests utilize link:https://github.com/onsi/ginkgo[`Ginkgo`] and its preferred matcher library link:https://github.com/onsi/gomega[`Gomega`] which define sets of test cases (spec). As per ginkgo test file comprises specs and these test file are controlled by test suite.

Test and test suite files are located in `tests/integration` directory and can be called using `make test-integration`.

To run ONE individual test, you can either:

* Supply the name via command-line: `ginkgo -focus="When executing catalog list without component directory" tests/integration/`
* Modify the `It` statement to `Fit` and run `ginkgo tests/integration/`

Integration tests validate and focus on specific fields of odo functionality or individual commands. For example, `cmd_app_test.go` or `generic_test.go`.

*E2e tests:*

This file was deleted.

0 comments on commit 70c5a6f

Please sign in to comment.
You can’t perform that action at this time.