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

Improve user experience with better manifest errors messages #1229

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

Fabien-Chouteau
Copy link
Member

This is patch introduces suggestions in various error messages from the manifest parser. A potential suggestion is made using edit distance computing from a list of possible values. If the quality is not deemed good enough, the full list of values is printed.

This is patch introduces suggestions in various error messages
from the manifest parser. A potential suggestion is made using
edit distance computing from a list of possible values. If the
quality is not deemed good enough, the full list of values is
printed.
@mosteo
Copy link
Member

mosteo commented Oct 26, 2022

Very cool!

@Fabien-Chouteau
Copy link
Member Author

@mosteo somethings wrong with the macOS CI. I don't think they updated the macos-latest version. Maybe it's GNAT 12.2...

@mosteo
Copy link
Member

mosteo commented Nov 9, 2022

I see... Strange, and different in each macOS setup. No immediate ideas to offer :/

@Fabien-Chouteau
Copy link
Member Author

@simonjwright we have some issues on macOS that I don't understand, in case you have some time to give it a look.

@simonjwright
Copy link
Contributor

I can find the tests, and I can run them locally, and I see failures. What I can’t see is how to run an individual test in diagnostic mode (i.e. so I can see what went wrong in detail).

@Fabien-Chouteau
Copy link
Member Author

-v -E for more detailed output and path to folder to filter tests e.g. tests/misc/did-you-mean

So ./run.py -v -E tests/misc/did-you-mean

@simonjwright
Copy link
Contributor

Here are the tests which failed when run together from the top level.

publish__check-pre-release-version

PASS

publish__local-repo

FAIL
_Output:
_Initialized empty Git repository in /private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmpzy5hjtqu/publish__local-repo/xxx/.git/
_[main (root-commit) 915db17] repo created
_ 9 files changed, 134 insertions(+)
_ create mode 100644 .gitignore
_ create mode 100644 alire.toml
_ create mode 100644 alire/alire.lock
_ create mode 100644 alire/config.toml
_ create mode 100644 config/xxx_config.ads
_ create mode 100644 config/xxx_config.gpr
_ create mode 100644 config/xxx_config.h
_ create mode 100644 src/xxx.adb
_ create mode 100644 xxx.gpr
_Cloning into 'xxx_local'...
_done.
_The following command:
_ alr -q -d -n --force publish . master
_Exitted with status code 1
_Output:
_stderr: Command ["git", "log", "master", "-n1", "--oneline", "--no-abbrev-commit"] exited with code 128 and output: fatal: ambiguous argument 'master': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git [...] -- [...]'
_stderr: Revision not found in local repository: master
_ERROR: Revision not found in local repository: master
_
_Traceback (most recent call last):
_ File "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmpzy5hjtqu/publish__local-repo/test.py", line 40, in
_ run_alr("--force", "publish", ".", "master")
_ File "/Users/simon/Developer/alire/testsuite/drivers/alr.py", line 112, in run_alr
_ raise CalledProcessError('alr returned non-zero status code')
_drivers.alr.CalledProcessError: alr returned non-zero status code

misc__did-you-mean

PASS

publish__local-repo-nonstd

FAIL
_Initialized empty Git repository in /private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmp_g19jvr1/publish__local-repo-nonstd/xxx/.git/
_[main (root-commit) 60ca0f5] repo created
_ 9 files changed, 134 insertions(+)
_ create mode 100644 .gitignore
_ create mode 100644 alire/alire.lock
_ create mode 100644 alire/config.toml
_ create mode 100644 config/xxx_config.ads
_ create mode 100644 config/xxx_config.gpr
_ create mode 100644 config/xxx_config.h
_ create mode 100644 src/xxx.adb
_ create mode 100644 xxx.gpr
_ create mode 100644 xxx.toml
_Cloning into 'xxx_local'...
_done.
_The following command:
_ alr -q -d -n --force publish . master --manifest xxx.toml
_Exitted with status code 1
_Output:
_stderr: Command ["git", "log", "master", "-n1", "--oneline", "--no-abbrev-commit"] exited with code 128 and output: fatal: ambiguous argument 'master': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git [...] -- [...]'
_stderr: Revision not found in local repository: master
_ERROR: Revision not found in local repository: master
_
_Traceback (most recent call last):
_ File "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmp_g19jvr1/publish__local-repo-nonstd/test.py", line 42, in
_ run_alr("--force", "publish", ".", "master", "--manifest", "xxx.toml")
_ File "/Users/simon/Developer/alire/testsuite/drivers/alr.py", line 112, in run_alr
_ raise CalledProcessError('alr returned non-zero status code')
_drivers.alr.CalledProcessError: alr returned non-zero status code

index__branch-mismatch

FAIL
_Traceback (most recent call last):
_ File "/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/tmp18xmgrcf/index__branch-mismatch/test.py", line 35, in
_ assert_match(".This alr build expects an index branch with prefix '.'"
_ File "/Users/simon/Developer/alire/testsuite/drivers/asserts.py", line 61, in assert_match
_ assert False, '\n'.join(text)
_AssertionError: Unexpected output
_Expecting a match on:
_ ".This alr build expects an index branch with prefix '.' but your community index branch is 'master'.*"
_But got:
_ "warning: This alr build expects an index branch with prefix 'stable' but your community index branch is 'main'"
_ "warning: You can disable this warning with configuration key 'warning.old_index'"
_ "warning: Index 'community' version (1.1.0) is older than the newest supported by alr (1.2.1)"
_ "warning: You can disable this warning with configuration key 'warning.old_index'"
_ "Note: If you experience any problems loading this index, you may need to reset the community index with 'alr index --reset-community'. Note that this operation will delete any local changes to the community index."
_ 'No hits'

misc__local-reject-origin

PASS

build_profile__default

PASS

@Fabien-Chouteau
Copy link
Member Author

Looks like you don't have the same errors as we have on the GitHub CI.

@simonjwright
Copy link
Contributor

My trouble seems to be that I’m running git version 2.37.0 (Apple Git-136) which defaults the initial branch to main, so that’s what helpers.py/init_git_repo() does; and the tests expect the branch to be master.

@mosteo
Copy link
Member

mosteo commented Nov 16, 2022

the tests expect the branch to be master

Ohhh well spotted.

@simonjwright
Copy link
Contributor

I’m getting a PR together. Running CI in my repo now.

@simonjwright
Copy link
Contributor

Gosh it’s slow! the macos runner took 1h7m to install the toolchain, and has already spent an hour in Run test script (without Homebrew) and is still compiling alire-releases.adb.

@simonjwright
Copy link
Contributor

I spoke too soon. See PR #1244.

@mosteo
Copy link
Member

mosteo commented Nov 17, 2022

So by merging this we are going temporarily with the old macOS version, right? At least it buys us some time.

@mosteo mosteo merged commit e24486c into master Nov 17, 2022
@mosteo mosteo deleted the did_you_mean branch November 17, 2022 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants