Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(NFC) karma - Enable all Civi components (not just CiviCase) #23450

Merged
merged 2 commits into from
May 12, 2022

Conversation

totten
Copy link
Member

@totten totten commented May 12, 2022

Overview

This is a small cleanup (suggested by @colemanw) that makes the karma.conf.js appear more general.

It modifies the startup process for a test-runner; as long as the test-runner still gives the same output, it should be safe.

(Note: The patch extends/depends upon #23449 because they modify adjacent lines. But functionally, they're separate.)

Before

karma loads baseline Angular modules and CiviCase Angular modules.

After

karma loads baseline Angular modules and any/all component-based Angular modules

Comment

Why was it only CiviCase? Not certain... but I think it's because (historically) crmMailing.ang.php did extra work to build settings, and this extra work was a bit too heavy. That work has moved (settings became settingsFactory) and maybe makes this safer.

totten added 2 commits May 12, 2022 13:49
Before
------

If you enable `debug_mode=1` and run `karma`, it produces a large number of failures:

```
PhantomJS 2.1.1 (Mac OS 0.0.0): Executed 81 of 81 (55 FAILED) (2.686 secs / 2.387 secs)
```

After
-----

If you enable `debug_mode=1` and run `karma`, it passes:

```
PhantomJS 2.1.1 (Mac OS 0.0.0): Executed 81 of 81 SUCCESS (7.232 secs / 6.95 secs)
```

Comments
--------

The `jsonFormatter` plugin is a DX nicety; when browsing a page with `?angularDebug=1` and with `debug_mode=1`, it will load extra
files so that `<crm-ui-debug>` panels look pretty. But ordinarily, loading these files is extraneous.
This is a small cleanup (suggested by @colemanw) that makes the `karma.conf.js` appear more general.

It modifies the startup process for a test-runner; as long as the test-runner still gives the
same output, it should be safe.

Before
------

`karma` loads baseline Angular modules and CiviCase Angular modules.

After
-----

`karma` loads baseline Angular modules and any/all component-based Angular modules

Comment
-------

Why was it only CiviCase?  Not certain...  but I *think* it's because
(historically) `crmMailing.ang.php` did extra work to build `settings`, and
this extra work was a bit too heavy.  That work has moved (`settings` became
`settingsFactory`) and maybe makes this safer.
@civibot
Copy link

civibot bot commented May 12, 2022

(Standard links)

@civibot civibot bot added the master label May 12, 2022
@seamuslee001
Copy link
Contributor

Looks good to me merging

@seamuslee001 seamuslee001 merged commit 1f3d285 into civicrm:master May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants