Skip to content

Commit 74055a4

Browse files
committed
test(plugins/community/splatoon): mocks
1 parent 1d9a7ab commit 74055a4

File tree

8 files changed

+1395
-21
lines changed

8 files changed

+1395
-21
lines changed

.github/workflows/examples.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,23 +1163,6 @@ jobs:
11631163
user: lowlighter
11641164
plugins_errors_fatal: yes
11651165
if: ${{ success() || failure() }}
1166-
- name: 🦑 Splatoon - Splatnet data with stat.ink integration
1167-
uses: lowlighter/metrics@master
1168-
with:
1169-
filename: metrics.plugin.splatoon.svg
1170-
token: ${{ secrets.METRICS_TOKEN }}
1171-
base: ""
1172-
plugin_splatoon: yes
1173-
plugin_splatoon_token: ${{ secrets.SPLATOON_TOKEN }}
1174-
plugin_splatoon_statink: yes
1175-
plugin_splatoon_statink_token: ${{ secrets.SPLATOON_STATINK_TOKEN }}
1176-
extras_css: |
1177-
h2 { display: none !important; }
1178-
output_action: none
1179-
delay: 120
1180-
user: lowlighter
1181-
plugins_errors_fatal: yes
1182-
if: ${{ success() || failure() }}
11831166
- name: 💹 Stock prices - Stock prices from Tesla
11841167
uses: lowlighter/metrics@master
11851168
with:

source/plugins/community/splatoon/examples.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
uses: lowlighter/metrics@latest
33
with:
44
filename: metrics.plugin.splatoon.svg
5-
token: ${{ secrets.METRICS_TOKEN }}
5+
token: NOT_NEEDED
66
base: ""
77
plugin_splatoon: yes
88
plugin_splatoon_token: ${{ secrets.SPLATOON_TOKEN }}
@@ -15,7 +15,7 @@
1515
uses: lowlighter/metrics@latest
1616
with:
1717
filename: metrics.plugin.splatoon.svg
18-
token: ${{ secrets.METRICS_TOKEN }}
18+
token: NOT_NEEDED
1919
base: ""
2020
plugin_splatoon: yes
2121
plugin_splatoon_token: ${{ secrets.SPLATOON_TOKEN }}
@@ -25,3 +25,5 @@
2525
h2 { display: none !important; }
2626
test:
2727
skip: true
28+
prod:
29+
skip: true

source/plugins/community/splatoon/index.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
4444
allowed.net.push("stat.ink")
4545
}
4646
switch (source) {
47+
case "mocks":
4748
case "local":
4849
console.debug(`metrics/compute/${login}/plugins > splatoon > skipping s3si execution`)
4950
break
@@ -54,8 +55,8 @@ export default async function({login, q, imports, data, account}, {enabled = fal
5455

5556
//Read fetched data
5657
const exported = await Promise.all(
57-
(await imports.fs.readdir(`${imports.__module(import.meta.url)}/s3si/export`))
58-
.map(async file => JSON.parse(await imports.fs.readFile(`${imports.__module(import.meta.url)}/s3si/export/${file}`))),
58+
(await imports.fs.readdir(`${imports.__module(import.meta.url)}/s3si/${source == "mocks" ? "mocks" : "export"}`))
59+
.map(async file => JSON.parse(await imports.fs.readFile(`${imports.__module(import.meta.url)}/s3si/${source == "mocks" ? "mocks" : "export"}/${file}`))),
5960
)
6061
const summary = exported.filter(({type}) => type === "SUMMARY").at(0)
6162
if (!summary)

source/plugins/community/splatoon/metadata.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ inputs:
9090
9191
- `splatnet` will fetch data from Splatnet using [spacemeowx2/s3si.ts](https://github.com/spacemeowx2/s3si.ts) tool
9292
- `local` will assume `s3si/export` directory already exists and is populated (use this when developping new features for this plugin to save network resources and time)
93+
- `mocks` will use `s3si/mocks` directory (use this when developping new features for this plugin to avoid setting up a NSO token)
9394
type: string
9495
default: splatnet
9596
values:
9697
- splatnet
9798
- local
99+
- mocks
98100
testing: yes
99101
preset: no

0 commit comments

Comments
 (0)