Skip to content

Conversation

@LucasRoesler
Copy link
Member

Rewrite the scaling tests into a table driven test and add support to
running in multiple namespaces.

Testing

kind create cluster

arkade install openfaas --basic-auth=false --clusterrole

kubectl create namespace certifier-test
kubectl annotate namespace/certifier-test openfaas="1"

export CERTIFIER_NAMESPACES=certifier-test

kubectl port-forward -n openfaas svc/gateway 8080:8080 &
make test-kubernetes

Resolves #70

Rewrite the scaling tests into a table driven test and add support to
running in multiple namespaces.

**Testing**

```sh
kind create cluster

arkade install openfaas --basic-auth=false --clusterrole

kubectl create namespace certifier-test
kubectl annotate namespace/certifier-test openfaas="1"

export CERTIFIER_NAMESPACES=certifier-test

kubectl port-forward -n openfaas svc/gateway 8080:8080 &
make test-kubernetes
```

Resolves openfaas#70

Signed-off-by: Lucas Roesler <[email protected]>
Copy link
Contributor

@viveksyngh viveksyngh left a comment

Choose a reason for hiding this comment

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

LGTM, few minor comments which are not blocker and can be improved in subsequent PR.


// the CLI sdk does not currently support manually scaling
gwURL := resourceURL(t, path.Join("system", "scale-function", name), "")
gwURL := resourceURL(t, path.Join("system", "scale-function", name), fmt.Sprintf("namespace=%s", namespace))
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if you have checked latest version of CLI SDK, it already has API for scaling functions https://github.com/openfaas/faas-cli/blob/master/proxy/scale.go

Probably we can use that or make an separate MR to update that.

if fnc.Replicas != minReplicas {
t.Fatalf("got %d replicas, wanted %d", fnc.Replicas, minReplicas)
}
type scalingTestCase struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Really Nice refactoring !!

@alexellis
Copy link
Member

Sorry I missed this. Could you trigger a rebuild since the last 3 commits seem to have failed CI?

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.

Add multi-namespace support for scaling test cases

3 participants