databrickslabs / databrickslabs/lsql

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

Open
#218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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))

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the integration test that uses the make_dashboard fixture and inspect the deploy-dashboard setup around it. Compare the requested make_directory fixture with the provided ucx example, then verify that the integration tests create and clean up a temporary remote directory instead of overwriting an empty unpublished dashboard.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.