-
Notifications
You must be signed in to change notification settings - Fork 154
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
Need help with initial meson test #1453
Comments
That's a great first issue. Thanks for contributing. Those errors should not occur. Are you perhaps running this in a chroot or other sandboxed environment? The fact the unit test harness can't find essential commands like Are you seeing those "not found" errors for all unit tests? What do you see in the log if you add P.S., One of the test environments I use to verify all changes to this project is a Ubuntu 16.04 32-bit VM. So it is definitely possible to build and successfully pass all unit tests on Ubuntu (as well as several other Linux distros). |
FWIW, Skipping some tests is expected due to deficiencies of specific platforms. For example, not having a /proc pseudo-filesystem. Those deficiencies either mean the unit test itself cannot run successfully or the behavior of the ksh binary depends on features that the platform does not provide. If any skipped tests should have been run, @hyenias, because your platform supports the necessary features we will be happy to enable those tests on your platform and deal with any test failures that result from that change. |
Bare metal, booted up an old PC x86_64 and installed Linux Mint 19.3 on it. Some of the required tooling was not available as packages on my ARM single board computers. Just a few hours ago, I successfully ran the TravisCI and all tests/builds past. :) Then, I moved to creating a local test environment. Within the testlog-malloc.txt file, the first test that has an issue is 123/293 API/ksh/ksh_debug with a FAIL. All prior tests above execute fine with an OK status. The immediate test above ksh_debug is 122/293 API/tm/tvgettime. From the ksh_debug point and below, the stderr sections have not founds for cat, rm, and chmod as well. After editing the run_test.sh with set -x statement, running "meson test b_alias.sh"; the various OLD_PATH, SAFE_PATH, FULL_PATH, and PATH all have the correct system directories. This individual test completes successfully. |
That is not surprising. The API tests (excluding the API/ksh/ tests) do not depend on the ksh scripting language. That the non-API ksh scripting tests fail with errors such as
That |
@hyenias You wrote
Are you trying to cross-compile? That isn't something we have spent a single second thinking about. So if that is what you are trying to do I am not surprised it results in failures. |
Programs do exist: I am just learning and attempting for the first time to contribute to an open source project that I believe in. I have attempted to follow the provided web docs to the best of my abilities. At this time, I do not know how to fix the situation of having error statements of not finding files. Any more suggestions, hints? I will try. |
FYI, I just spot checked other tests down the line that passed but had the not founds in them and after running them singularly no issues were noted in the log files. |
$ which addr2line |
I just repeated my above steps on one of my ARM boxes running Ubuntu 18.04 and the log file has the same not founds in them. However, on this system it has an additional failure at: Starting at the "123/293 API/ksh/ksh_debug FAIL 0.30 s" part of the log file and below the not founds show up on all remaining tests to end of file. |
Is it x86_64 or ARM? I get the sense you're trying to build ksh on both architectures and having problems on both. In which case I'd like to suggest focusing on one of them, preferably x86_64, until you have a clean build and all tests pass. Then we can deal with other architectures.
Please attach the entire build/meson-logs/testlog.txt log file to this issue. It's not that I don't believe you but in my four decades working with computers it has been my experience that people see what they expect to see. Thus sometimes overlooking an important detail (e.g., semi-colons where colons should be present). Please also attach the build/meson-logs/meson-log.txt log file. P.S., I see your original comment makes no mention of doing P.P.S., Note that meson thinks nearly all the unit tests are passing. So either those "not found" errors are either irrelevant or they're keeping the unit tests from even being run. But even if irrelevant they should not be present in the test log so we need to determine the root cause of those messages. |
After review of my notes and history log, I made some mistakes in the information I provided yesterday. I actually ended up editing two separate files with the set -x command at the top. With all the new, flipping back-and-forth from web browser and command prompts, as well as paging through 120k lines of a log file; I focused on the wrong run_test.sh file. My mind no longer possessed the awareness needed to see the differences. I apologize. By having a break and spending more time with the log file, I have become more familiar with it and as such noticed the details today. I can now express the problem to a better degree. The meson test commands create two separate log files depending on how you run them:
Each of these log files have their content created from two separate run_test.sh scripts. The libast run script executes first for tests 1-122 ending with "122/293 API/tm/tvgettime". The cmd run_test.sh scripts picks up at "123/293 API/ksh/ksh_debug" to end of file "293/293 special-dev-paths.sh/shcomp".
I wanted a little easier way for my untrained eyes to see the PATHing problems in each of these run_test.sh scripts. So, I removed the set -x commands from the top of the files and adding in the following. In ast/src/lib/libast/tests/run_test.sh after:
I added:
Then skip down a little after:
I added:
Then I repeated the process for ast/src/cmd/ksh93/tests/util/run_test.sh:
I inserted the following right after the above function:
Skip down a little again after
Added this
Finally, I executed the meson test --setup=malloc command. When I examined its meson-logs/testlog-malloc.txt file, I noticed several things:
Now with success and knowledge of what is going wrong with meson test --setup=malloc command, I wondered why running just meson test works. If you run just meson test for all tests or just a single test, such as meson test b_alias.sh, the correct user path is available for use for OLD_PATH. Problem Summarymeson test --setup=malloc command fails to incorporate path from user environment. In particular, ast/src/lib/libast/tests/run_test.sh uses another source for PATH other than user's perhaps even hard coded. ast/src/cmd/ksh93/tests/util/run_test.sh somehow fails to inherit PATH from user environment. Note: Running a meson test without the malloc option executes successfully by utilizing user's PATH for all tests as well as single test. time meson test --setup=malloc
time meson test
|
krader1961, I did not notice your updated comment within my web browser. I had been editing my comment for quite some time. |
It appears that enabling malloc debugging causes your platform to unset, or otherwise mangle,
We can certainly test for @hyenias What is your interactive shell? Bash? Zsh? Csh? Something else? Have you checked your shell config files to see if they are the reason |
Also, again, please attach the files in the build/meson-logs/ directory. We know what those logs should contain and can examine them for unexpected content much more easily than someone new to the project 😄 |
@hyenias Does https://github.com/krader1961/ast/commit/8faaac480e8a9733a50c08ae972a3cc9b9797d96, without your edits to the test scripts, fix this issue? |
I had to do some research on the various shells and then investigate them. Currently, my default login shell is set to bash. I knew about the /etc/environment file that only contains the default path for my system; in the past, I had removed /usr/games:/usr/local/games from it. As for your interactive shell influencing the mangling of the PATH environment variable train-of-thought, I decided to create a new test user account on my system and remove as much startup script loading for each of the interactive shells I could before running the various meson tests again. This test user does not have the oclint program available to it. Unfortunately, no matter which interactive shell I used; the not founds persisted when malloc was used. I have selected to run only the single tests for comparison. Updated steps for test build
I will start working on the log files. Then, move towards testing your fix out. |
Here the files. |
Yes, your commit 071352e from your ast fork at krader1961 on github under the empty-path branch worked for the malloc tests. As before starting at the API/ksh/ksh_debug test, the path was empty/unset and your additions provided a minimal path.
|
@hyenias I'd still like to know why your ksh test environment does not have a |
@krader1961 Thank you for all of the hard work and time spent towards attempting to resolve this issue I opened up. As a new github user and with a different level of willingness to help the project, I was taken back to find my issue closed. From my viewpoint, by having my issue closed; it hides away an unresolved problem from others in the community that might wish to assist in resolving this issue. Since I do not see a reopen button on my web browser, this causes me to have a sad face. After all, my issue was closed without concurrence or a chance to reply after only 4 hours. It made me think, "Is this a team of 1?" Surely not, as I know there are others in the community. Or perhaps I am just too new to this all and in order to perform a commit to master branch you needed to close the associated issue along with it. What were the results of your analysis of the log files I provided? It would be nice if you shared your efforts with the community. I, for one, am trying to learn. At this time, I particularly do not wish your workaround to be incorporated into master as it masks problem(s). If the environment is troubled, let it be troubled and hopefully cause something to error out or fail in some way so it can be addressed. Perhaps a separate PATH test should be added at the beginning of the cases but I prefer to try to resolve the problem. As I already know how to manually set my complete path into the run scripts, I can do that on my test boxes or just not test with the malloc option until I figure out why. |
@hyenias The logs show, indirectly, that Line 163 in 2950ede
ast/src/lib/libast/path/pathbin.c Line 36 in 2950ede
However, that existing workaround only works if the var is unset:
If set to the empty string the workaround to have a sensible, minimal,
The reason all of the ksh tests were passing for you, despite all the command "not found" errors in the test log, is that the resulting test harness script had nothing but the And, after sleeping on the issue, I've decided to move the workaround, minus the warnings about PATH being empty, into the recently introduced global config file. I closed this issue because there isn't anything else for us to do. Figuring out whatever is causing |
Nice reply! Nothing but gold. Thank you so much for educating me on the insights gained from my logs and more. Especially, I now know why the two run_test.sh's differed. That narrows the possibilities. Excellent, work. I am glad that this issue has brought some light on the unit tests not failing when they were not even run. To me this is huge problem as tests should fail if they do not work that is why you have them. Hopefully, you or the team will find a way to alter the meson test scripts to account for it. I did not know about the existence of a new global config file. I will have a look at this latter when I finally get my test environment up and running as I want to be able to contribute code changes to this project. I will continue to investigate why this behavior occurs on my systems. I am not convinced that my issue only occurs with my setups as they are mostly fresh installed systems from various Ubuntu 18.04 based Linux distributions. I will circle back to the basics before attempting to learn the strace command or using some DPRINTF() calls. Thank you for making me aware of those commands. |
Sure, but consider that is also true every time the unit tests are run in each Travis CI environment. I'm sure I, and anyone else, will be able to reproduce this once we know what it is about your environment that is triggering this behavior. But so far, in the past two years, only you, and no one else, has reported seeing this behavior. Which is a pretty strong indicator there is something unique about your environment. The question is, what is that unique characteristic? One frequent source of unexpected behavior is incorrect handling of a locale that is not ASCII compatible (which includes the ISO 8859 and Unicode UTF-8 encodings). It's unlikely to be the cause of this issue but I'm curious what the output of |
Took a little time but I found the root cause, a workaround, and a fix. While learning from this issue I have found other issues. One of which being the restricted shell issue that I believe you have already solved. I will work on collecting my notes and conveying the results for this issue then open up other issues for other things I found. |
@hyenias That's great. And, despite what some other individuals seem to think, I actually do care about all bugs in this project. Especially those introduced since the ksh93v- release; i.e., by the work done by myself and @siteshwar over the past two years. @jghub Read this issue and think about how the O.P. acted when they found a problem. Then think about how it compares to your behavior. |
@hyenias: |
Description of problem:
After going through all the instructions I could find on the site, some test cases have either failed or been skipped. meson-logs/testlog-malloc.txt indicates that various programs along its path cannot be found.
Ksh version:
GNU/Linux x86_64 Ubuntu 18.04
2020.0.0-beta1-192-g0d76ee4b
How reproducible:
Run meson with --prefix ~/kshdev and meson test.
Steps to reproduce:
Actual results:
OK: 277
FAIL: 1
SKIP: 15
TIMEOUT: 0
123/293 API/ksh/ksh_debug FAIL 0.13 s
Within the testlog-malloc.txt file under a test case between the stderr section:
stderr:
xxx/git/ast/src/cmd/ksh93/tests/util/run_test.sh: line 219: mkfifo: not found
xxx/git/ast/src/cmd/ksh93/tests/util/run_test.sh: line 220: mkfifo: not found
xxx/git/ast/src/cmd/ksh93/tests/util/run_test.sh: line 239: mkdir: not found
xxx/git/ast/src/cmd/ksh93/tests/util/run_test.sh: line 240: mkdir: not found
xxx/git/ast/src/cmd/ksh93/tests/util/run_test.sh[464]: run_api: line 270: diff: not found
run_test[272]: Stderr for ksh_debug had unexpected differences:
xxx/git/ast/src/cmd/ksh93/tests/util/run_test.sh[464]: run_api: line 273: diff: not found
Expected results:
No previous experience to compare with, not sure. Overall, I would hope that all the possible tests would run and pass. All of the not found programs have been installed and exist along the PATH.
Additional info:
I am a new github user and new to this ksh repo. I believe that I have installed all of the required programs that were mentioned within the CONTRIBUTING.md and wiki section Building and Debugging (meson). I look forward to getting my development environment up and running so that I can contribute to this ksh project.
The text was updated successfully, but these errors were encountered: