Skip to content
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

[TECH DEBT] Replace the make_dashboard integration test fixture with make_directory #218

Open
JCZuurmond opened this issue Jul 11, 2024 · 0 comments

Comments

@JCZuurmond
Copy link
Member

Instead of creating an empty, unpublished dashboard in the integration test to overwrite later. A temporary remote directory can be passed as parent path to the deploy dashboard:

  1. Overwriting an empy, unpublished dashboard is a bit of hack
  2. The remote directory can get a purge suffix so that it will be deleted by watch dog in case it is not cleaned up properly

Copy from ucx:

@pytest.fixture
def make_directory(ws, make_random):
    def create(*, path: str | None = None):
        if path is None:
            path = f"/Users/{ws.current_user.me().user_name}/lsql-{make_random(4)}-{get_purge_suffix()}"
        ws.workspace.mkdirs(path)
        return path

    yield from factory("directory", create, lambda x: ws.workspace.delete(x, recursive=True))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant