arquillian-cube icon indicating copy to clipboard operation
arquillian-cube copied to clipboard

Support more than one namespace?

Open jwendell opened this issue 9 years ago • 4 comments

Currently (in openshift adapter) it seems we can use only one, static namespace, which must be provided upon creation time.

Is it possible to use more than one namespace?

My scenario would be: Run each class on its own namespace instead of having one namespace for the whole test suite.

We could add an observer for BeforeClass for instance, setting the namespace to be used...

jwendell avatar Jun 07 '16 20:06 jwendell

I'd like to have even more than that - possibility to work in several namespaces in one test. I see it as being able to specify namespace like that:

@Named(value = "test-pod", namespace = "some-namespace")

It would be very usable in situations when we have two services: A being located in testing namespace T and B being located in some default namespace D.

Example: In configuration we set namespace.use.existing = T In test we declare two services with port forward like that:

    @Named(value = "A")
    @ArquillianResource
    @PortForward
    private Service serviceA;

    @Named(value = "B", namespace = "D")
    @ArquillianResource
    @PortForward
    private Service serviceB;

During test we'd call service A through port-forwarded address serviceA, service A calls service B requesting something like http://B.D:8080 and after that test would verify how state of service B changed by requesting it again through port-forward - using serviceB.

strowk avatar Nov 26 '17 20:11 strowk

@jwendell The question is, currently if you do not do anything Cube creates a new random itest namespace created by test suite execution. So what you are saying here is just create one per each test class. This has some implications in the sense that we need to create a new attribute that allows user to define the scope of namespace creation (suite or class) and update this information as well.

@strowk What you are mentioning here is having support for several already created namespaces, so what you mention here has sense but notice that in this case means that Cube is not responsible of deploying and creating all these namespaces, it is responsible of the test preparation to have everything in place, isn't it?

lordofthejars avatar Nov 27 '17 06:11 lordofthejars

I'm trying to remember what was my motivation to ask this at the time. Blame on me for not writing an use case in my report :/

jwendell avatar Nov 27 '17 14:11 jwendell

@lordofthejars Yeah, in the implementation I've provided those additional namespaces are considered already existing and filled with all required resources.

We may divide the namespaces to primary and secondary. While Cube may be (if configured to) responsible for deploying of exactly one primary namespace, it could also inject into test instance resources from any number of secondary namespaces if necessary, but their existence at the time of test run is considered a prerequisite as well as existence of Openshift/Kubernetess instance.

strowk avatar Dec 01 '17 21:12 strowk