Page MenuHomePhorge

The Celerity unit tests are not automatically run when touching whatever CSS or JS file
Open, HighPublic

Description

If you do:

$ arc unit --everything
...
   FAIL  PhabricatorCelerityTestCase::testCelerityMaps
Assertion failed, expected 'true' (at PhabricatorCelerityTestCase.php:32): When this test fails, it means the Celerity resource map is out of date. Run `bin/celerity map` to rebuild it.

ACTUAL VALUE
false
...

It can happen that it helps you in detecting that you need to run Celerity.

But, if you edit a CSS file, it can happen that this unit test is just skipped and marked as green light, like it happened here and here:

D25088: Workboard: in some cases, increase menu opacity (accessibility)

D25384: Fix icon background color when using Dark Mode

D25520: Show title entirely and cut of secondary information gracefully in typeahead results of main search

D25631: Update d3 from version 5.9.2 to 6.7.0

It says: Lint Not Applicable and Harbormaster completed the build:

B165: Diff 377

Saying "passed":

https://we.phorge.it/harbormaster/build/165/

What happens now

I touch CSS files.

So, it seems, arc diff calls arc unit, and then arc unit does not runs the unit tests related to Celerify.

What should happen instead

I touch CSS files.

So arc diff calls arc unit, and then arc unit runs the unit tests related to Celerify.

Note that this is the name of this specific unit test:

PhabricatorCelerityTestCase::testCelerityMaps

List of some known cases

Feel free to add a path here, if you toched that file, but the arc lint didn't say anything:

webroot/rsrc/css/phui/workboards/phui-workboard-color.css
webroot/rsrc/js/application/diffusion/DiffusionLocateFileSource.js
webroot/rsrc/css/application/base/main-menu-view.css
webroot/rsrc/externals/d3/

Possible Causes

This test at the moment probably does not fire, because the test is inside the /src directory but should probably be in the / directory of the repo:

https://we.phorge.it/source/phorge/browse/master/src/__tests__/PhabricatorCelerityTestCase.php;ed9d212013cd0d8747f92bca4e7cb94900bccfd5

Possible Fixes

Maybe moving this file:

src/__tests__/PhabricatorCelerityTestCase.php

Here:

__tests__/PhabricatorCelerityTestCase.php

So the test runs for whatever code change, and not just code changes inside the /src directory.

Event Timeline

valerio.bozzolan triaged this task as Normal priority.
valerio.bozzolan created this object in space S1 Public.
valerio.bozzolan renamed this task from The Celerity unit tests are not automatically run when touching a CSS file to The Celerity unit tests are not automatically run when touching whatever CSS or JS file.Jul 3 2023, 08:25
valerio.bozzolan updated the task description. (Show Details)
valerio.bozzolan updated the task description. (Show Details)
avivey raised the priority of this task from Normal to High.Jul 3 2023, 08:43