-
Notifications
You must be signed in to change notification settings - Fork 10
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
Credential type not saved in test #249
Comments
I tried this locally on my machine and the test passes. |
Thx for trying! I pushed a small push to get some insight. Here it is: diff --git a/datalad_next/commands/tests/test_download.py b/datalad_next/commands/tests/test_download.py
index 45fff9f..96a83c1 100644
--- a/datalad_next/commands/tests/test_download.py
+++ b/datalad_next/commands/tests/test_download.py
@@ -208,9 +208,16 @@ def test_download_no_credential_leak_to_http(capsys):
'dataladtest_test_download_new_bearer_token',
])
def test_download_new_bearer_token(capsys):
+ from pprint import pprint
+ print('====query=====')
+ credentials('query')
+ print('====query done=====')
try:
download({f'{hbsurl}/bearer': '-'})
# and it was saved under this name
+ print('====checkcred=====')
+ pprint(credentials('get', name='dataladtest_test_download_new_bearer_token', on_failure='ignore'))
+ print('====checkcred done=====')
assert_result_count(
credentials(
'get',
@@ -218,10 +225,15 @@ def test_download_new_bearer_token(capsys):
1, cred_secret='token123', cred_type='token',
)
finally:
- credentials(
+ print('====remove=====')
+ pprint(credentials(
'remove',
name='dataladtest_test_download_new_bearer_token',
- )
+ ))
+ print('====remove done=====')
+ print('====checkcred=====')
+ pprint(credentials('get', name='dataladtest_test_download_new_bearer_token', on_failure='ignore'))
+ print('====checkcred done=====') Which gives:
which is very different from what I get locally:
It looks as if the credential storing code path though the credential manager never happened in the CI. That fact that it fails uniformly across all CIs and has not been observed outside the CIs is confusing. With a locally deployed
|
This may be of no particular relevance, but to get the "wrong" credential, this could be what is running:
So maybe the credential retrieval setup, running inside the downloader is somehow not passing any identifying info, besides a secret. |
OK, next round. Still cannot replicate. I have now enabled datalad/datalad#7298 and the following patch diff --git a/datalad_next/commands/tests/test_download.py b/datalad_next/commands/tests/test_download.py
index 45fff9f..235362a 100644
--- a/datalad_next/commands/tests/test_download.py
+++ b/datalad_next/commands/tests/test_download.py
@@ -207,9 +207,10 @@ def test_download_no_credential_leak_to_http(capsys):
# after download, it asks for a name
'dataladtest_test_download_new_bearer_token',
])
-def test_download_new_bearer_token(capsys):
+def test_download_new_bearer_token(memory_keyring, capsys):
try:
download({f'{hbsurl}/bearer': '-'})
+ breakpoint()
# and it was saved under this name
assert_result_count(
credentials( with that I see (again on a machine where things work):
|
So it seems on a FAILING github action AND on appveyor run I get the exact same thing:
So the credential is saved properly, but something is broken with the reporting. progress at last!! |
returns
So that is fine too... |
So inside It returns the crippled credential!
The call is exactly the same, same arguments, just the instance is different. |
Maybe...maybe for some reason the underlying |
A dedicated |
I filed datalad/datalad#7299 which is what I currently believe is causing this unfortunate behavior -- that I have merely triggered with recent changes: Recently the As part of that Whenever any test had caused the instantiation of a But because of datalad/datalad#7299 and the way the This explanation is backed up by a report from @adswa that a prior run of the I believe datalad/datalad#7299 should be fixed to have Until that happens, each command using |
When called with `dataset=None`, `credentials()` would auto-locate a dataset containing CWD (and use its configuration), whereas `download()` would use the global configuration in this case. This change makes the behavior uniform and chooses what `download()` did as the model behavior. This uniformatization is meaningful on its own. However, due to datalad/datalad#7299 it is also a necessity, because otherwise credentials deposited by `download()` remain invisible to `credentials()` -- which is the superficial trigger for datalad#249 Closes datalad#249
This is evident from #248 even after it fixes #245
So far, this does not replicate for me locally, and also not outside the main CI run on an appveyor machine. It seems to be some evil interaction with the test setup. Grrrr.
The text was updated successfully, but these errors were encountered: