-
Notifications
You must be signed in to change notification settings - Fork 1
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
Skare3 ci #21
Conversation
With regard to final review, I'm not sure if it is ready without the ska_testr tests done on a spec? I'm also not sure how to run it. Me, I just hacked a local version or |
yes, and actually... it is failing that one :-) so definitely not ready for final review. Removing the tag. |
It took me a while to figure out. Like all puzzles, the first hurdle is to convince yourself that something is wrong... I have tracked all test failures to the call to ska_helpers.get_version. It seems to have a side effect of changing the environment. For example, importing kadi causes DJANGO_SETTINGS_MODULE to appear in os.environ. This causes the kadi and chandra_aca failure. I still do not know the exact chain of events. |
so... the question is how to fix it.
One thing that puzzles me is that, these two differ:
|
I don't immediately understand why having DJANGO_SETTINGS_MODULE set is breaking other things. Do you understand that? |
I have seen this error multiple times in aca_view. It has to do with the way django initializes, combined with how much stuff a child process inherits. If django is initialized in the parent process, all models and such are created there. Then the child process inherits "something" no which prevents the child process from initializing django again, but it does not inherit the models (hence no maneuvers). |
The failures in the acis code were different. I have not gone to see the chain of events, but they were fixed by the same change in ska_helpers. |
OK, so the hypothesis is that the environment variable is just another symptom of the same problem (kadi/django already initialized), but having the variable set is not the real problem? |
I'm mostly trying to figure out if this should be fixed in ska_helpers or if some kind of reasonable change should be made in kadi. |
I have not checked if the acisfp_check failures are because of the same environmental variable. I'm checking now. I think it is, but the final error looks different. |
Ugh. This has always been a thorn to thread the needle between the kadi web app and kadi package app. Django changed things at some point between 1.6 and 3.0 that made it trickier to do both. See Basically if But each time I see this problem I also get confused and have to dig into it again... |
Looking up the thread, if the child process inherits |
OK, so it sounds to me like @javierggt 's idea to do a fix not in kadi (most likely in ska_helpers in a child process) makes sense for our current use cases. It seems awkward but doable? But now I'm confused about @taldcroft 's last comment with regard to the child process |
I'm just saying that if, for some reason,
|
@taldcroft's comment about the child process just agrees with what I said above.
So there is no perfect solution. |
Shouldn't there be a way to get the version without importing (and avoid all possibility of side effects?). https://stackoverflow.com/questions/4693608/find-path-of-module-without-importing-in-python
The only reason I can see now for the import is to get the module |
I think that's better. I was also wondering if it was possible to not import. I think that will fix it. |
some of the failing tests passed. running all test_spec_SKA3_HEAD now. |
…gument relative to --root.
My hope is that there is a solution so that one can do I tried adding |
I specified the junit_family option on the command line and it works. I tried it in shiny, and I was surprised to see it also worked in the older pytest version in ska3, so no conditional required. |
@taldcroft and @jeanconn, I think this is ready. The one thing I am not sure I did to your liking was the --regress-dir option. I do not understand the logic behind the previous directory layout, and this version by default will put log and regress directories side by side for each run, within each run's directory (the one pointed to with the "last" link). This is documented in the sphinx documentation linked above. |
Now I recall the rationale for the original structure, which is that it makes it relatively easy to diff two versions using
The issue with your new structure is that |
I see. With my changes you would have to do
|
Ah, no problem them. I had guessed without looking that it would be something like |
My main comment now is considering this an opportunity to simplify. I have only myself to blame, but the user interface seems "over-configurated" and I think we could reduce to just two directory options:
Otherwise this looks fine. I have not gone through the code in fine detail but if there is a problem we can fix it. |
yes, I agree with that. Will commit in a bit so we are done with this. |
but note that this change would amount to removing arguments that are already optional. |
🎉 |
Description
This PR makes some changes that are convenient within the CI process:
Documentation can temporarily be found here.
After this PR, testr will not work with ska_helpers version 0.1.1 or earlier.
Note
There is an inherent inconsistency that comes from using testr to begin with. When a pytest test is skipped, all the test cases in there are not reported as skipped. All test suites in there are also not reported. The whole file is reported as a single test case. On the other hand, if it is run, then it is reported as a test suite, and all test cases are reported. This really bugs me.
I can (and will) use some heuristics downstream to figure out whether a given test was actually a test suite. This is not ideal.
Interface impact
This PR introduces a change in behavior. It introduces the
--root
option, which allows testr to be called from a different directory than its configuration directory.Before this PR:
--packages-dir
,--outputs-dir
and--regress-dir
were implicitly interpreted either as absolute paths, or as paths relative to the configuration directory (same as the working directory).--outputs-subdir
was assumed to be a relative path, but a user could actually provide an absolute path.After this PR:
--outputs-subdir
is gone. outputs-subdir is always given by the get_version script.--regress-dir
is gone. Now there are two directories within outputs-subdir: logs and regress.--packages-dir
is gone. It is allways join(outputs-subdir, 'packages')Testing
--root
--root
and--outputs-dir
--root $ROOT --test-spec test_spec_Ska.ftp
--root $ROOT --test-spec test_spec_SKA3_HEAD