Page MenuHomePhabricator

VCR tests sometimes create cassettes for the default wiki, adding untracked files to git status
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Make sure there is nothing to commit
  2. Edit user-config.py
    1. Set mylang to test
    2. Set family to wikidata
  3. Run python -m unittest tests.api_tests.TestCachedRequest
  4. Get git status:
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        tests/cassettes/wikidata.test/TestCachedRequest.test_normal_use.yaml

nothing added to commit but untracked files present (use "git add" to track)

Running a dry test has added a new undesired file. It's annoying to have these files created every time the developer runs the tests. It could be committed accidentally if they use git add -A. Note that .yaml files may contain private information which leads to security/privacy risks for the developer.

Running VCR tests should not have the side effect of creating new cassettes (except when we developer is adding new tests of-course).

Maybe we should not have VCR tests configured for DefaultSiteTestCase?

Details

Related Gerrit Patches:
pywikibot/core : masterRevert "Setup VCR for dry tests"

Event Timeline

Dalba created this task.Jun 10 2018, 8:11 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJun 10 2018, 8:11 AM
Vvjjkkii renamed this task from VCR tests sometimes create cassettes for the default wiki, adding untracked files to git status to lbbaaaaaaa.Jul 1 2018, 1:04 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from lbbaaaaaaa to VCR tests sometimes create cassettes for the default wiki, adding untracked files to git status.Jul 2 2018, 2:58 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Change 457082 had a related patch set uploaded (by Dalba; owner: dalba):
[pywikibot/core@master] Revert "Setup VCR for dry tests"

https://gerrit.wikimedia.org/r/457082

Xqt closed this task as Resolved.Sep 2 2018, 8:01 AM
Xqt claimed this task.

Change 457082 merged by jenkins-bot:
[pywikibot/core@master] Revert "Setup VCR for dry tests"

https://gerrit.wikimedia.org/r/457082