Skip to content

proposal: testing: Add a way to disable cache for spesific tests #64462

@saberder

Description

@saberder

Proposal Details

Add a way disable test cache for spesific tests (ie. t.NoCache() )
Test are a great way to add some sanity checks while programming for things like:

  • is my dev env sucesfully logging in correctly to an api
  • what is this spesific function currently returning

With cache these usescases get cached and we have to run go clean -testcache every time, and can trick people into thinking that some connection is working, when in reality the function is returning an empty list.
This is preventing us from using vscode golang extention and the play button feature to run spesific tests for these kind of scenarios.
Screenshot from 2023-11-30 11-43-57

ref: #24573 (comment)
if we could do something like t.NoCache() to mark specific tests. Otherwise everyone will just disable cache altogether with -count=1. I run into this problem when I simply changed sql fixture file, so I would like that specific test to run without caching but I would like to cache others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Proposal

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions