Skip to content

create a unit test for reinstalling a driver #38

Closed

Description

@amoeba

We should have a unit test to cover the following case:

At time point t_0, the driver index has driver foo at version 1.0.0. The user installs foo with dbc install foo and they get 1.0.0 installed at foo.toml. At time point t_1, the driver index has foo version 1.0.0 and 1.1.0. The user re-runs dbc install foo. What should happen?

I think,

  • dbc should replace foo.toml with a fresh foo.toml
  • dbc should not delete the old foo_{$platform}_v1.0.0 folder
  • When finished, the drivers dir should have this structure,
$ tree .
.
├── foo_macos_arm64_v1.0.0
│   └── libadbc_driver_foo.dylib
├── foo_macos_arm64_v1.1.0
│   └── libadbc_driver_foo.dylib
└── foo.toml

4 directories, 2 files

Activity

  1. added this to the 0.0.1 milestone on Sep 15, 2025
  2. added theissue type on Sep 15, 2025
  3. amoeba commented on Sep 15, 2025

    @amoeba
    MemberAuthor

    Note: This unit test, once written, should currently pass so I don't think there's any feature work here.

  4. zeroshade commented on Sep 18, 2025

    @zeroshade
    Member

    Looks like we currently do delete the old foo_${platform}_v1.0.0 folder. So if we want to keep the old one around, then we need to do some feature work. We should also make sure that uninstall deletes all versions, right?

  5. zeroshade commented on Sep 18, 2025

    @zeroshade
    Member

    another question: if we're going to leave the old version, then shouldn't we first check if that exists before we go re-downloading the old version on an install? That seems a bit dangerous. We should only leave the old version if it wasn't installed with dbc (source != 'dbc'), right?

  6. amoeba commented on Sep 19, 2025

    @amoeba
    MemberAuthor

    We should only leave the old version if it wasn't installed with dbc (source != 'dbc'), right?

    Yeah, and I think I have changed my mind on whether we should or shouldn't remove the old version on reinstall. If we leave the old version in place, the user has to work much harder to use it because there's no manifest for it. So it's better to remove it and not leave it hanging around.

  7. zeroshade commented on Sep 19, 2025

    @zeroshade
    Member

    cool, then we can close this as solved by #47 then which ads the unit test and confirms that the previous one is cleaned up

  8. added a commit that references this issue on Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions