dvc studio login automatically push experiments by default (#10331)

* studio login set auto_push + add logs for the user

* set a separate global config dir for studio login tests

The `isolate` fixture sets a separate, _isolated_ global config directory.
But it is shared among other tests. So any mutations to it affects other
tests too.

We should force `studio login` tests to use a separate tmp_dir for global config.

* cleanup message

---------

Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
This commit is contained in:
AlexandreKempf
2024-03-05 11:48:16 +05:45
committed by GitHub
co-authored by Saugat Pachhai
parent cd1e228e55
commit b0384f8f51
3 changed files with 27 additions and 0 deletions
+9
View File
@@ -1,9 +1,18 @@
import pytest
from dvc_studio_client.auth import AuthorizationExpiredError
from dvc import env
from dvc.cli import main
from dvc.utils.studio import STUDIO_URL
@pytest.fixture(autouse=True)
def global_config_dir(monkeypatch, tmp_dir_factory):
monkeypatch.setenv(
env.DVC_GLOBAL_CONFIG_DIR, str(tmp_dir_factory.mktemp("studio-login"))
)
def test_studio_login_token_check_failed(mocker):
mocker.patch(
"dvc_studio_client.auth.get_access_token",