Page MenuHomePhabricator

Unit test is not skipped if ArcanistLinter::getCacheVersion throws an ArcanistUsageException
Closed, ResolvedPublic

Description

When a linter is invoked using ArcanistLintEngine, it is able to access the configuration manager for the working copy with $this->getEngine()->getConfigurationManager().

However, when being invoked from ArcanistUnitEngine (through ArcanistPhutilTestCase), the linter does not have access to the project configuration. This means that the path for an external linter will not be used.

Event Timeline

joshuaspence assigned this task to epriestley.
joshuaspence raised the priority of this task from to Normal.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Arcanist.
joshuaspence added a subscriber: joshuaspence.

The expectation is that you'll provide configuration in a test case explicitly (i.e., a test case should not rely on configuration elsewhere in the project or on the system). There may not actually be a way to do this right now, as we haven't needed one so far, I think.

Thinking about it more, I think that your expectation is reasonable.

However, I noticed that if ArcanistLinter::getCacheVersion throws ArcanistUsageException (which it will if an external linter is not installed), then the unit test will not be skipped (as one would expect).

joshuaspence renamed this task from ArcanistLinterTestCase is not aware of configuration to Unit test is not skipped if ArcanistLinter::getCacheVersion throws an ArcanistUsageException.Jan 9 2014, 1:56 AM
joshuaspence claimed this task.
joshuaspence added a subscriber: epriestley.