Skip to content

Commit

Permalink
Remove _RELEASEPY_TEST_CREDENTIALS and use --auth in test
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Nov 13, 2024
1 parent d7dcb2d commit af2ecae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
5 changes: 4 additions & 1 deletion check_releasepy.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash -e

export _RELEASEPY_DEBUG=1
export _RELEASEPY_TEST_CREDENTIALS=1

test_dir=$(mktemp -d)
export _RELEASEPY_TEST_RELEASE_REPO="${test_dir}/test-release"
Expand All @@ -27,6 +26,7 @@ exec_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
--auth user:fake \
gz-foo 1.2.3 ${test_params}
}

Expand All @@ -37,6 +37,7 @@ exec_ignition_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
--auth user:fake \
ign-foo 1.2.3 ${test_params}
}

Expand All @@ -47,6 +48,7 @@ exec_ignition_gazebo_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
--auth user:fake \
ign-gazebo 1.2.3 ${test_params}
}

Expand All @@ -56,6 +58,7 @@ exec_releasepy_with_real_gz()
./release.py \
--dry-run \
--no-sanity-checks \
--auth user:fake \
--source-repo-uri http://github.com/gazebosim/gz-common \
--source-repo-existing-ref http://github.com/gazebosim/gz-common/foo-tag \
"${gz_pkg}" "${major_version}.x.y"
Expand Down
14 changes: 2 additions & 12 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@ def parse_args(argv):
# BEGIN: Credentials code copied from ros_buildfarm
#
def get_credentials(jenkins_url=None):
try:
if os.environ['_RELEASEPY_TEST_CREDENTIALS']:
return 'fake_user', 'fake_api_token'
except KeyError:
pass

config = ConfigParser()
config_file = get_credential_path()
if not os.path.exists(config_file):
Expand Down Expand Up @@ -385,12 +379,8 @@ def sanity_checks(args, repo_dir):
sanity_check_sdformat_versions(args.package, args.version)
sanity_project_package_in_stable(args.version, args.upload_to_repository)

try:
if os.environ['_RELEASEPY_TEST_CREDENTIALS']:
pass
except KeyError:
check_credentials(args.auth_input_arg)
print_success("Jenkins credentials are good")
check_credentials(args.auth_input_arg)
print_success("Jenkins credentials are good")

shutil.rmtree(repo_dir)

Expand Down

0 comments on commit af2ecae

Please sign in to comment.