mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
test refactor: try decouple admin tests from other tests
This commit is contained in:
4
.github/integration-test.py
vendored
4
.github/integration-test.py
vendored
@@ -167,7 +167,7 @@ def run_test(
|
|||||||
command = f"python3 /srv/src/bootstrap/bootstrap.py --version={upgrade_from}"
|
command = f"python3 /srv/src/bootstrap/bootstrap.py --version={upgrade_from}"
|
||||||
run_command(container_name, command)
|
run_command(container_name, command)
|
||||||
|
|
||||||
command = f"python3 /srv/src/bootstrap/bootstrap.py {installer_args}"
|
command = f"python3 /srv/src/bootstrap/bootstrap.py {' '.join(installer_args)}"
|
||||||
run_command(container_name, command)
|
run_command(container_name, command)
|
||||||
|
|
||||||
# Install pkgs from requirements in hub's pip, where
|
# Install pkgs from requirements in hub's pip, where
|
||||||
@@ -219,7 +219,7 @@ def main():
|
|||||||
copy_parser.add_argument("dest")
|
copy_parser.add_argument("dest")
|
||||||
|
|
||||||
run_test_parser = subparsers.add_parser("run-test")
|
run_test_parser = subparsers.add_parser("run-test")
|
||||||
run_test_parser.add_argument("--installer-args", default="")
|
run_test_parser.add_argument("--installer-args", action="append")
|
||||||
run_test_parser.add_argument("--upgrade-from", default="")
|
run_test_parser.add_argument("--upgrade-from", default="")
|
||||||
run_test_parser.add_argument("--bootstrap-pip-spec", default="/srv/src")
|
run_test_parser.add_argument("--bootstrap-pip-spec", default="/srv/src")
|
||||||
run_test_parser.add_argument("container_name")
|
run_test_parser.add_argument("container_name")
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ async def test_admin_login():
|
|||||||
Test if the admin that was added during install can login with
|
Test if the admin that was added during install can login with
|
||||||
the password provided.
|
the password provided.
|
||||||
"""
|
"""
|
||||||
username = "admin"
|
username = "test-admin-username"
|
||||||
password = "admin"
|
password = "test-admin-password"
|
||||||
|
|
||||||
async with User(username, hub_url, partial(login_dummy, password=password)) as u:
|
async with User(username, hub_url, partial(login_dummy, password=password)) as u:
|
||||||
await u.login()
|
await u.login()
|
||||||
@@ -24,8 +24,8 @@ async def test_admin_login():
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"username, password",
|
"username, password",
|
||||||
[
|
[
|
||||||
("admin", ""),
|
("test-admin-username", ""),
|
||||||
("admin", "wrong_passw"),
|
("test-admin-username", "wrong_passw"),
|
||||||
("user", "password"),
|
("user", "password"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ def ensure_user_environment(user_requirements_txt_file):
|
|||||||
|
|
||||||
def ensure_admins(admin_password_list):
|
def ensure_admins(admin_password_list):
|
||||||
"""
|
"""
|
||||||
Setup given list of users as admins.
|
Setup given list of user[:password] strings as admins.
|
||||||
"""
|
"""
|
||||||
os.makedirs(STATE_DIR, mode=0o700, exist_ok=True)
|
os.makedirs(STATE_DIR, mode=0o700, exist_ok=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user