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

Script to run local e2e test #1110

Merged
merged 1 commit into from
May 21, 2020
Merged

Conversation

bowei
Copy link
Member

@bowei bowei commented May 21, 2020

hack/run-local-e2e.sh will setup your environment and
write some scripts to help run e2e tests from a locally built
binary.

Usage

$ ./hack/run-local-e2e.sh my-cluster
...
$ bash /tmp/run-glbc.sh # run proxy and controller

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 21, 2020
@bowei
Copy link
Member Author

bowei commented May 21, 2020

@rramkumar1 @spencerhance

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 21, 2020
@bowei
Copy link
Member Author

bowei commented May 21, 2020

/assign @rramkumar1 @spencerhance

@k8s-ci-robot
Copy link
Contributor

@bowei: GitHub didn't allow me to assign the following users: spencerhance.

Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @rramkumar1 @spencerhance

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

local name=$1
local zone=$2
# Globals.
nodeTag=$(gcloud compute instances describe gke-test-default-pool-2b81ea3d-sw3l --zone us-west2-b --format='value(tags.items[0])')
Copy link
Contributor

Choose a reason for hiding this comment

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

fix this? Seems to be hardcoded.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -0,0 +1,89 @@
#/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be called run-local.sh? It's just running the controller, not the e2e tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, fixing

fi

fmt='value(networkConfig.network,networkConfig.subnetwork,zone,selfLink,name)'
parseCluster $(gcloud container clusters list --format=${fmt} | grep "${clusterName}\$")
Copy link
Contributor

Choose a reason for hiding this comment

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

if there two clusters with the same name in different zones would this work? I think the script should accept zone/region as an arg.

Copy link
Member Author

Choose a reason for hiding this comment

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

added optional param

@rramkumar1
Copy link
Contributor

When trying this locally I get the following error:

deployment.extensions/l7-default-backend configured
service/default-http-backend configured
/tmp/run-glbc.sh: line 24: --apiserver-host=http://localhost:7127: No such file or directory
Killing proxy (pid=125670)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 21, 2020
@bowei
Copy link
Member Author

bowei commented May 21, 2020

fixed issues, got rid of unneeded script generation

hack/setup-local.sh will setup your environment to be able to
run locally for easy development.

Usage

$ gcloud auth application-default login
...
$ ./hack/setup-local.sh
...
$ ./hack/run-glbc-local.sh
...
^C
fi

GCECONF=${GCECONF:-/tmp/gce.conf}
GLBC=${GLBC:-./glbc}
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to assume the glbc executable is in this directory? If you run the script as is, it won't work unless you build first and move the executable here.

Copy link
Member Author

Choose a reason for hiding this comment

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

you can do that by

GLBC=mypath/xxx hack/run-local-glbc.sh

@rramkumar1
Copy link
Contributor

/lgtm

@rramkumar1 rramkumar1 merged commit 8151640 into kubernetes:master May 21, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 21, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei, rramkumar1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants