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

Allow for plugin testing. #1272

Merged
merged 1 commit into from
Dec 26, 2014
Merged

Conversation

matschaffer
Copy link
Contributor

With this change in place you can include plugin specs in grunt test by creating a src/config.js like that includes something like this:

      plugins: {
        // list of plugin panels
        panels: [],
        // requirejs modules in plugins folder that should be loaded
        // for example custom datasources
        dependencies: ['grafana-plugins/atlas.Datasource'],
        specs: ['grafana-plugins/specs/atlasDatasource-specs']
      }

With this change in place you can include plugin specs in `grunt test` by creating a `src/config.js` like that includes something like this:

```js
      plugins: {
        // list of plugin panels
        panels: [],
        // requirejs modules in plugins folder that should be loaded
        // for example custom datasources
        dependencies: ['grafana-plugins/atlasDatasource'],
        specs: ['grafana-plugins/specs/atlasDatasource-specs']
      }
```
@matschaffer
Copy link
Contributor Author

The large-sized change was due to some issues I hit trying to use helper.js from both a plugin spec and the regular specs. Seems that asking require to load the same file from two different paths causes a load time out. Injecting the helper got around this.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 85e50ec on matschaffer:plugin-spec-support into 32ae0ea on grafana:master.

@torkelo
Copy link
Member

torkelo commented Dec 23, 2014

This looks great! Will merge tomorrow if I can find the time!

torkelo added a commit that referenced this pull request Dec 26, 2014
@torkelo torkelo merged commit 7be2105 into grafana:master Dec 26, 2014
@ying-jeanne ying-jeanne added the pr/external This PR is from external contributor label Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/external This PR is from external contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants