Skip to content

Commit

Permalink
Run second test...
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Nov 29, 2022
1 parent 3f7477d commit d3ad2d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/toolshed.yaml
Expand Up @@ -53,7 +53,7 @@ jobs:
path: 'galaxy root/.venv'
key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-toolshed
- name: Run tests
run: './run_tests.sh -toolshed lib/tool_shed/test/functional/test_shed_repositories.py::TestShedRepositoriesApi::test_reset_on_simple_repository'
run: './run_tests.sh -toolshed lib/tool_shed/test/functional/test_shed_repositories.py::TestShedRepositoriesApi::test_reset_on_simple_repository lib/tool_shed/test/functional/test_shed_repositories.py::TestShedRepositoriesApi::test_repo_tars'
working-directory: 'galaxy root'
- uses: actions/upload-artifact@v3
if: failure()
Expand Down
27 changes: 7 additions & 20 deletions lib/tool_shed/util/hg_util.py
Expand Up @@ -29,7 +29,7 @@

def _debug_hg_status(cwd: str) -> str:
try:
return _hg_execute_raw("status", cwd)
return _hg_execute_raw(["status"], cwd)
except subprocess.CalledProcessError as cpe:
return f"*Failed to execute hg status - output was {unicodify(cpe.output)}"
except Exception as e:
Expand All @@ -38,7 +38,7 @@ def _debug_hg_status(cwd: str) -> str:

def _debug_hg_log(cwd: str) -> str:
try:
return _hg_execute_raw("log", cwd)
return _hg_execute_raw(["log"], cwd)
except subprocess.CalledProcessError as cpe:
return f"*Failed to execute hg log - output was {unicodify(cpe.output)}"
except Exception as e:
Expand Down Expand Up @@ -76,8 +76,8 @@ def _hg_execute(args: List[str], cwd: str):
["hg", "--verbose", *args],
e.returncode,
unicodify(e.output),
status=_debug_hg_status(cwd),
log=_debug_hg_log(cwd),
status_output=_debug_hg_status(cwd),
log_output=_debug_hg_log(cwd),
)


Expand All @@ -93,6 +93,7 @@ def archive_repository_revision(app, repository, archive_dir, changeset_revision

def commit_changeset(repo_path, full_path_to_changeset, username, message):
try:
log.info(f"about to commit with hg status [{_debug_hg_status(repo_path)}]")
_hg_execute(["commit", "-u", username, "-m", message, full_path_to_changeset], repo_path)
except HgExecutionException as e:
if e.nothing_changed_error:
Expand Down Expand Up @@ -272,28 +273,14 @@ def init_repository(repo_path):
"""
Create a new Mercurial repository in the given directory.
"""
try:
subprocess.check_output(["hg", "init"], stderr=subprocess.STDOUT, cwd=repo_path)
except Exception as e:
error_message = f"Error initializing repository: {unicodify(e)}"
if isinstance(e, subprocess.CalledProcessError):
error_message += f"\nOutput was:\n{unicodify(e.output)}"
raise Exception(error_message)
_hg_execute(["init"], repo_path)


def changeset2rev(repo_path, changeset_revision):
"""
Return the revision number (as an int) corresponding to a specified changeset revision.
"""
try:
rev = subprocess.check_output(
["hg", "id", "-r", changeset_revision, "-n"], stderr=subprocess.STDOUT, cwd=repo_path
)
except Exception as e:
error_message = f"Error looking for changeset '{changeset_revision}': {unicodify(e)}"
if isinstance(e, subprocess.CalledProcessError):
error_message += f"\nOutput was:\n{unicodify(e.output)}"
raise Exception(error_message)
rev = _hg_execute(["id", "-r", changeset_revision, "-n"], repo_path)
return int(rev.strip())


Expand Down

0 comments on commit d3ad2d2

Please sign in to comment.