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

Fix e2e-kubeadm release-1.6 job. #2765

Merged
merged 1 commit into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scenarios/kubernetes_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def kubeadm_version(mode):
raise ValueError('STABLE_BUILD_SCM_REVISION not found')
version = status.group(1)

# Work-around for release-1.6 jobs, which still upload debs to an older
# location (without os/arch prefixes).
# TODO(pipejakob): remove this when we no longer support 1.6.x.
if version.startswith("v1.6."):
return 'gs://kubernetes-release-dev/bazel/%s/build/debs/' % version

elif mode == 'pull':
version = '%s/%s' % (os.environ['PULL_NUMBER'], os.getenv('PULL_REFS'))

Expand Down
37 changes: 36 additions & 1 deletion scenarios/kubernetes_e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
'STABLE_gitMajor 1\n' \
'STABLE_gitMinor 7+\n'

FAKE_WORKSPACE_STATUS_V1_6 = 'STABLE_BUILD_GIT_COMMIT 84febd4537dd190518657405b7bdb921dfbe0387\n' \
'STABLE_BUILD_SCM_STATUS clean\n' \
'STABLE_BUILD_SCM_REVISION v1.6.4-beta.0.18+84febd4537dd19\n' \
'STABLE_BUILD_MAJOR_VERSION 1\n' \
'STABLE_BUILD_MINOR_VERSION 6+\n' \
'STABLE_gitCommit 84febd4537dd190518657405b7bdb921dfbe0387\n' \
'STABLE_gitTreeState clean\n' \
'STABLE_gitVersion v1.6.4-beta.0.18+84febd4537dd19\n' \
'STABLE_gitMajor 1\n' \
'STABLE_gitMinor 6+\n'

def fake_pass(*_unused, **_unused2):
"""Do nothing."""
pass
Expand Down Expand Up @@ -95,10 +106,15 @@ def fake_check_env(self, env, *cmd):
self.callstack.append(string.join(cmd))

def fake_output_work_status(self, *cmd):
"""fake a workstatus bolb."""
"""fake a workstatus blob."""
self.callstack.append(string.join(cmd))
return FAKE_WORKSPACE_STATUS

def fake_output_work_status_v1_6(self, *cmd):
"""fake a workstatus blob for v1.6."""
self.callstack.append(string.join(cmd))
return FAKE_WORKSPACE_STATUS_V1_6


class LocalTest(ScenarioTest):
"""Class for testing e2e scenario in local mode."""
Expand Down Expand Up @@ -174,6 +190,25 @@ def test_kubeadm_periodic(self):
called = True
self.assertTrue(called)

def test_kubeadm_periodic_v1_6(self):
"""Make sure kubeadm periodic mode has correct version on v1.6"""
args = self.parser.parse_args(['--mode=local', '--kubeadm=periodic'])
self.assertEqual(args.mode, 'local')
self.assertEqual(args.kubeadm, 'periodic')
with Stub(kubernetes_e2e, 'check_env', self.fake_check_env):
with Stub(kubernetes_e2e, 'check_output', self.fake_output_work_status_v1_6):
kubernetes_e2e.main(args)

self.assertIn('E2E_OPT', self.envs)
self.assertIn('--kubernetes-anywhere-kubeadm-version gs://kubernetes-release-dev/bazel/'
'v1.6.4-beta.0.18+84febd4537dd19/build/debs/', self.envs['E2E_OPT'])
called = False
for call in self.callstack:
self.assertFalse(call.startswith('docker'))
if call == 'hack/print-workspace-status.sh':
called = True
self.assertTrue(called)

def test_kubeadm_pull(self):
"""Make sure kubeadm pull mode is fine overall."""
args = self.parser.parse_args(['--mode=local', '--kubeadm=pull'])
Expand Down