Skip to content

Commit

Permalink
Add test case for slack
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
  • Loading branch information
dims committed Aug 19, 2022
1 parent 78e5712 commit b822690
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/k8s-io/configmap-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ data:
listen 80;
location / {
rewrite ^/.$ https://communityinviter.com/apps/kubernetes/community permanent;
rewrite ^/.*$ https://communityinviter.com/apps/kubernetes/community permanent;
}
}
Expand Down
10 changes: 8 additions & 2 deletions apps/k8s-io/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def assert_multischeme_redirect(self, partial_url, expected_loc, expected_code,
self.assert_scheme_redirect(
scheme + '://' + partial_url, expected_loc, expected_code, **kwargs)

def assert_temp_redirect(self, partial_url, expected_loc, **kwargs):
self.assert_multischeme_redirect(partial_url, expected_loc, 302, **kwargs)
def assert_permanent_redirect(self, partial_url, expected_loc, **kwargs):
self.assert_multischeme_redirect(partial_url, expected_loc, 301, **kwargs)

def test_main_urls(self):
# Main redirects, HTTPS to avoid protocol upgrade redirect.
Expand Down Expand Up @@ -390,6 +390,12 @@ def test_release(self):
'https://github.com/kubernetes/kubernetes/tree/$ver/$path',
ver=rand_num(), path=rand_num())

def test_slack(self):
for base in ('slack.k8s.io', 'slack.kubernetes.io'):
self.assert_permanent_redirect(base, 'https://communityinviter.com/apps/kubernetes/community')
self.assert_permanent_redirect(base + '/$path', 'https://communityinviter.com/apps/kubernetes/community',
path=rand_num())

def test_submit_queue(self):
for base in ('submit-queue.k8s.io', 'submit-queue.kubernetes.io'):
self.assert_temp_redirect(base, 'https://prow.k8s.io/tide')
Expand Down

0 comments on commit b822690

Please sign in to comment.