-
Notifications
You must be signed in to change notification settings - Fork 108
Fortran fpm help_test invokes fpm #343
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
Comments
A lot has changed since it was written, including where a "run" only did a build test if the binary was missing, but it was my understandng that each test was run in an environment that was created on demand and included the fpm command. It is running the help on the latest version built by the fpm command. I have not looked recently at a build log but the last time I looked it displayed the expected version number and did not show a build of fpm itself in the log file. So it has been testing the latest version successfully in the manner expected. Need a better definition of exactly how the test environment is deployed that the tests run in, but what you describe sounds basically what would be desired if the test environment is set up the way I thought; so need some more details, as I believe those conditions are not supposed to occur for the test environment. |
You can see a new build starting in the testing environment at https://github.com/fortran-lang/fpm/runs/1754249868?check_suite_focus=true#step:12:2331 in the test step. Also a common case I encountered this was when testing a bootstrapped build with
|
It builds the latest version if required and runs the new copy to verify it gets the expected results. It is slower than expected but is doing the intended test. I believe there is an item open to add more actual fpm tests; but testing the actual executable in the CLI and help tests was intentional. I might have misunderstood the exact nature of the test environment? Is it overwriting something? I thought the test environment was created on the fly specifically to do testing like this. What exactly is damaged? |
The rebuild appears to be because the test invokes both the I would say that the desired behaviour for tests is to test the current build configuration only. i.e. The Line 36 in c485357
Hence this test is not actually running at all for the binary release version specified in our CI. This problem is related to #328 in terms of a test needing information about its context. A possible solution suggested by Brad is to provide environment variables for the build output directory, however this does rely on some specification of the output file structure which has thus far been avoided. It is worth noting also that |
I made the cli_test version before discussions about just what the test environment was. During development of the help_test I made inquiries about whether fpm could be called and at the time that apparently was considered OK. I was under the impression the test environment was a virtual platform created on demand for the tests and had the f-fpm command in it's path. PS: |
Yes you're right @urbanjost, we do need a way of testing the application end-to-end in addition to unit tests. As you're aware we have previously found bugs with the CLI this way. The issue for discussion is what is the best way to call the executable from a test. For the reasons I mentioned I don't think calling fpm run from within the test is the best option. (The problem isn't with the test environment.) Since we don't have support for the required path environment variables currently (needs discussion/specification), do you think you would be able to test the same functionality by invoking the test executable like the |
I think that fpm needs a facility for integration/end-2-end testing.
Given that we would like to at least encourage these test be portable (i.e. work for any environment that fpm supports), d and e imply some sort of fpm specific scripting language. Or maybe fpm could carry around a Bash implementation to run these scripts? What do you guys think? |
That would be a great addition, with 1, 2, 3a-c the important functionality. 3d and 3e could possibly be implemented outside of fpm by a package used as dev-dependency or by a combination of |
The help_test currently invokes fpm, this usually triggers a complete rebuild of both debug and release version unconditionally.
fpm/fpm/test/help_test/help_test.f90
Lines 21 to 46 in c485357
It might also invoke another version of fpm or completely fail if no fpm is in the PATH.
The text was updated successfully, but these errors were encountered: