Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial docs about writing extended test #4258

Merged
merged 3 commits into from Aug 26, 2015

Conversation

mfojtik
Copy link
Member

@mfojtik mfojtik commented Aug 19, 2015

(this is just a draft ;-)

TODO

  • Describe CLI interface (oc.Run())
  • Describe Kubernetes E2E framework (point to godoc?)
  • Provide example extended test with explanation
  • Add more todo items


The structure of this directory is following:

* **`test/extended/util`** provides useful helpers and utilities to use in your extended test. It provides a easy-to-use interface to OpenShift CLI and also
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to the dir?

[**`test/extended/util`**](../test/extended/util)

@stevekuznetsov
Copy link
Contributor

Add some information and a link to this README after this section here.

------------------

In order to execute the extended tests, you have to install
[Ginkgo](https://github.com/onsi/ginkgo) framework which is used in extended
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the how-to:
go get github.com/onsi/ginkgo/ginkgo

@jhadvig
Copy link
Member

jhadvig commented Aug 19, 2015

@mfojtik I've added the CLI interface part. PTAL

@mfojtik
Copy link
Member Author

mfojtik commented Aug 20, 2015

@stevekuznetsov thanks! I moved the docs into README.md

The structure of this directory is following:

* [**`test/extended/util`**](util) provides useful helpers and utilities to use in your extended test. It provides a easy-to-use interface to OpenShift CLI and also
access to the Kubernetes [E2E framework](https://github.com/openshift/origin/tree/master/Godeps/_workspace/src/k8s.io/kubernetes/test/e2e) helpers. It also contains OpenShift helpers are shared across multiple test cases, to make the test cases more DRY.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/OpenShift helpers are/OpenShift helpers that are/

@bparees
Copy link
Contributor

bparees commented Aug 21, 2015

@mfojtik this looks like a good start, one thing i'd add is an explanation of how the whole flow works, ie starting with the test-extend.sh script, what parameters that takes to decide what to run, etc.

@gabemontero
Copy link
Contributor

We may want to have a ref to the common bash functions in hack/util.sh
that hack/test-extended/default/run.sh and
hack/test-extended/forcepull/run.sh now leverage.

Thoughts @bparees @mfojtik @jhadvig ?

On Fri, Aug 21, 2015 at 1:13 PM, Ben Parees notifications@github.com
wrote:

@mfojtik https://github.com/mfojtik this looks like a good start, one
thing i'd add is an explanation of how the whole flow works, ie starting
with the test-extend.sh script, what parameters that takes to decide what
to run, etc.


Reply to this email directly or view it on GitHub
#4258 (comment).

@bparees
Copy link
Contributor

bparees commented Aug 21, 2015

@gabemontero +1

@bparees
Copy link
Contributor

bparees commented Aug 23, 2015

one more thing to add: how to run a specific test within a group, assuming that's possible...

@mfojtik
Copy link
Member Author

mfojtik commented Aug 24, 2015

@bparees @gabemontero thanks! I going to add all docs you mention

@bparees
Copy link
Contributor

bparees commented Aug 24, 2015

@mfojtik is there a way to run a single test (single .go file or single Describe within it?) or is "group" the finest level of granularity?


In order to make the test runner shell scripts more DRY, we bundled common
functions into a Bash helpers you can run instead of copy&pasting the code from
other launchers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name the file where this is bundled.

@gabemontero
Copy link
Contributor

Only had 4 minor typo kind of corrections on top of the @bparees comment about listing the location of the base helpers.... pending further input from others, igtm

@stevekuznetsov
Copy link
Contributor

@bparees The run scripts for extended tests are currently changing - they will soon have the following syntax:
hack/test-extended.sh bucket filter where bucket defines the bucket to be run, and filter is piped into gingko -focus= which runs any tests that match the filter. Unless we create some sort of look-up table from test to bucket, though, you will not be able to specify a test by itself and instead need to specify its' bucket. I assume you would be able to specify all buckets, but unless there is a ginkgo dry-run (@mfojtik ??), we don't have a way of finding if a gikgo -focus matches any tests in a bucket and instead would need to do the entire bucket set-up just to realize there are no tests to run.

@bparees
Copy link
Contributor

bparees commented Aug 24, 2015

having just written my first extended test (yay!), a couple things i found confusing related to buckets/focuses...

we have scripts like:
hack/test-extended/forcepull/run.sh

which runs ginkgo with the "forcepull" focus

but then forcepull.go is located under "test/extended/builds/forcepull.go"

and then everything else under "builds" is under the "default" focus.

If i wanted to figure out what "hack/test-extended/forcepull/run.sh" was going to run, i'd have intuitively looked for "test/extended/forcepull/somefiles.go"

it seems like a bit of a mish-mash. intuitively i'd expect that tests with the same "focus" would live in the same directory and there would be some script i could run (or argument to a script) which would run all the tests in that directory. (again ideally i'd be able to pick a specific test from a specific directory, too)

@stevekuznetsov what defines a "bucket" in this impending refactor? perhaps that will make it more like what i was thinking...

@gabemontero
Copy link
Contributor

Yeah I originally had a separate forcepull subdir but then switched based on comment from @mfojtik. Forcepull is still build related (hence same dir) but needs to run separately (hence a different focus). Admittedly without understanding that distinction it seems confusing. I ultimately don't feel strongly either way, but did like the idea of exposing forcepull at the subdir / group level.

Gabe

On Aug 24, 2015, at 6:34 PM, Ben Parees notifications@github.com wrote:

having just written my first extended test (yay!), a couple things i found confusing related to buckets/focuses...

we have scripts like:
hack/test-extended/forcepull/run.sh

which runs ginkgo with the "forcepull" focus

but then forcepull.go is located under "test/extended/builds/forcepull.go"

and then everything else under "builds" is under the "default" focus.

If i wanted to figure out what "hack/test-extended/forcepull/run.sh" was going to run, i'd have intuitively looked for "test/extended/forcepull/somefiles.go"

it seems like a bit of a mish-mash. intuitively i'd expect that tests with the same "focus" would live in the same directory and there would be some script i could run (or argument to a script) which would run all the tests in that directory. (again ideally i'd be able to pick a specific test from a specific directory, too)

@stevekuznetsov what defines a "bucket" in this impending refactor? perhaps that will make it more like what i was thinking...


Reply to this email directly or view it on GitHub.

@mfojtik
Copy link
Member Author

mfojtik commented Aug 25, 2015

@bparees @gabemontero right, it is a little bit confusing, but I don't want to introduce a lot of extra Go packages for different test groups. Especially when the tests really are 'builds' test or 'images' tests.

I think one solution could be to use --dry-run option when executing the tests (or provide that option to the shell launcher) to see what tests are going to be executed.

@bparees
Copy link
Contributor

bparees commented Aug 25, 2015

@mfojtik if the only alternative is a lot of go packages, i agree, just wanted to raise the discussion if only to ensure it gets documented clearly.

@mfojtik mfojtik changed the title [WIP] Initial docs about writing extended test Initial docs about writing extended test Aug 25, 2015
@mfojtik
Copy link
Member Author

mfojtik commented Aug 25, 2015

[merge]

We will improve these docs as we go.

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3119/) (Image: devenv-fedora_2222)

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/4480/)

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to ebffbc9

@stevekuznetsov
Copy link
Contributor

@bparees The original intent of the buckets (as per @deads2k) was functional separation - don't start up a cluster with a router if there is no router necessary for it.

Thinking more about it, however, as these are extended tests we don't particularly need them to be isolated, we care if they fail when the router is up even if they don't run the router. It would make sense to only have buckets if they have some sort of conflicting setup needs for the cluster, which I am not sure we have right now.

@bparees
Copy link
Contributor

bparees commented Aug 26, 2015

i'm not sure if buckets and focus are two separate ways of grouping things but basically there are two needs here:

1a) defining the configuration a particular set of tests need. this would include "tests that don't need a router" (though i don't see the point in grouping that separately...if you don't need a router, don't use it..don't start a whole separate openshift server w/o a router for that purpose...but perhaps there's a more legitimate use case here).

1b) tests which need to be run serially, not in parallel (the forcepull test which mucks with the images on the host filesystem and therefore could screw up other tests running at the same time is an example of this)

  1. grouping by functional area...if i'm changing build code, i want an easy way to run the build-related extended tests, not the entire bucket of everything which is going to be huge and slow.

So whatever we're driving at, i'd expect it to provide those 2.5 levels of division. And it should be easy for a user to at least understand how to run buckets grouped by (2).

As a user it's probably not as important I be able to run "all the tests that don't need a router" or "all the tests that can't be run in parallel".

so if we're already there, great..if not, let's figure out how to restructure things so we can get those characteristics. And if we can do it in such a way that the directory structure/scripts make more logical sense, even better :)

@deads2k
Copy link
Contributor

deads2k commented Aug 26, 2015

I only care about functional area. Ben's item 2.

I see the parallel/serial and configuration as the responsibility of the individual bucket owner. Maybe interesting, but not essential or particularly useful in all cases.

I'd like to see the bash for startup behave similarly to the integration tests where we make a config that is easy to mutate and then start it. That should help dry out the scripts and reduce pain without making painful, prescriptive metadata that doesn't really help reduce overall complexity.

@mfojtik
Copy link
Member Author

mfojtik commented Aug 26, 2015

re [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to ebffbc9

openshift-bot pushed a commit that referenced this pull request Aug 26, 2015
@openshift-bot openshift-bot merged commit 986da29 into openshift:master Aug 26, 2015
@mfojtik mfojtik deleted the extended-docs branch September 5, 2018 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants