tests: generated tests for plugins
This commit is contained in:
23
tests/cases/core.plugin.yml
Normal file
23
tests/cases/core.plugin.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- name: 🧱 Core - Organization
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
user: github
|
||||
token: MOCKED_TOKEN
|
||||
base: header, repositories
|
||||
- name: 🧱 Core - Large display
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
config_display: large
|
||||
- name: 🧱 Core - JSON metrics
|
||||
if: ${{ success() || failure() }}
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
config_output: json
|
||||
- name: 🧱 Core - PNG metrics
|
||||
if: ${{ success() || failure() }}
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
config_output: png
|
||||
@@ -1,6 +1,6 @@
|
||||
- name: '💉 Nightscout - '
|
||||
uses: lowlighter/metrics@latest
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
plugin_nightscout: 'yes'
|
||||
plugin_nightscout_url: https://testapp.herokuapp.com/
|
||||
name: 💉 Nightscout - (unnamed)
|
||||
5
tests/cases/poopmap.plugin.yml
Normal file
5
tests/cases/poopmap.plugin.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
plugin_poopmap: 'yes'
|
||||
name: 💩 PoopMap plugin - (unnamed)
|
||||
@@ -96,7 +96,7 @@ const metadata = JSON.parse(`${
|
||||
const tests = []
|
||||
for (const name in metadata.plugins) {
|
||||
const cases = yaml
|
||||
.load(fs.readFileSync(path.join(__dirname, "../tests/plugins", `${name}.yml`), "utf8"))
|
||||
.load(fs.readFileSync(path.join(__dirname, "../tests/cases", `${name}.yml`), "utf8"))
|
||||
?.map(({ name: test, with: inputs, modes = [], timeout }) => {
|
||||
const skip = new Set(Object.entries(metadata.templates).filter(([_, { readme: { compatibility } }]) => !compatibility[name]).map(([template]) => template))
|
||||
if (!(metadata.plugins[name].supports.includes("repository")))
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
- name: 🧱 Core - Classic template
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
base: header, repositories
|
||||
plugin_lines: 'yes'
|
||||
- name: 🧱 Core - Repository template
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
template: repository
|
||||
token: MOCKED_TOKEN
|
||||
user: lowlighter
|
||||
repo: metrics
|
||||
plugin_lines: 'yes'
|
||||
plugin_followup: 'yes'
|
||||
plugin_projects: 'yes'
|
||||
plugin_projects_repositories: lowlighter/metrics/projects/1
|
||||
- name: 🧱 Core - Terminal template
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
template: terminal
|
||||
token: MOCKED_TOKEN
|
||||
base: header, metadata
|
||||
- name: 🧱 Core - Markdown template
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
template: markdown
|
||||
markdown: metrics.markdown.template.md
|
||||
config_output: markdown
|
||||
token: MOCKED_TOKEN
|
||||
- name: 🧱 Core - Markdown template (with plugins)
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
template: markdown
|
||||
markdown: >-
|
||||
https://raw.githubusercontent.com/lowlighter/metrics/master/source/templates/markdown/example.md
|
||||
config_output: markdown
|
||||
plugin_activity: 'yes'
|
||||
plugin_activity_limit: 7
|
||||
plugin_activity_days: 0
|
||||
plugin_activity_filter: issue, pr, release, fork, review, ref/create
|
||||
plugin_posts: 'yes'
|
||||
plugin_posts_source: dev.to
|
||||
plugin_posts_descriptions: 'yes'
|
||||
plugin_posts_covers: 'yes'
|
||||
plugin_posts_limit: 2
|
||||
plugin_rss: 'yes'
|
||||
plugin_rss_source: https://news.ycombinator.com/rss
|
||||
plugin_rss_limit: 4
|
||||
plugin_tweets: 'yes'
|
||||
plugin_tweets_token: MOCKED_TOKEN
|
||||
plugin_tweets_user: github
|
||||
plugin_tweets_attachments: 'yes'
|
||||
plugin_tweets_limit: 2
|
||||
plugin_topics: 'yes'
|
||||
plugin_topics_limit: 24
|
||||
plugin_isocalendar: 'yes'
|
||||
plugin_languages: 'yes'
|
||||
token: MOCKED_TOKEN
|
||||
- name: 🧱 Core - Markdown template (pdf output)
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
template: markdown
|
||||
markdown: >-
|
||||
https://raw.githubusercontent.com/lowlighter/metrics/master/source/templates/markdown/example.pdf.md
|
||||
config_output: markdown-pdf
|
||||
plugin_rss: 'yes'
|
||||
plugin_rss_source: https://news.ycombinator.com/rss
|
||||
plugin_rss_limit: 4
|
||||
plugin_isocalendar: 'yes'
|
||||
config_twemoji: 'yes'
|
||||
config_padding: 5%
|
||||
token: MOCKED_TOKEN
|
||||
- name: 🧱 Core - Community templates
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
template: '@classic'
|
||||
setup_community_templates: lowlighter/metrics@master:classic
|
||||
modes:
|
||||
- action
|
||||
- name: 🧱 Core - Organization
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
user: github
|
||||
token: MOCKED_TOKEN
|
||||
base: header, repositories
|
||||
- name: 🧱 Core - Large display
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
config_display: large
|
||||
- name: 🧱 Core - JSON metrics
|
||||
if: ${{ success() || failure() }}
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
config_output: json
|
||||
- name: 🧱 Core - PNG metrics
|
||||
if: ${{ success() || failure() }}
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
config_output: png
|
||||
@@ -1,5 +0,0 @@
|
||||
- name: '💩 PoopMap plugin - '
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
plugin_poopmap: 'yes'
|
||||
Reference in New Issue
Block a user