Skip to content

replace template_spec test with config_variables test#4034

Merged
KristjanESPERANTO merged 3 commits intoMagicMirrorOrg:developfrom
khassel:var-test
Feb 9, 2026
Merged

replace template_spec test with config_variables test#4034
KristjanESPERANTO merged 3 commits intoMagicMirrorOrg:developfrom
khassel:var-test

Conversation

@khassel
Copy link
Collaborator

@khassel khassel commented Feb 8, 2026

After introducing new config loading this PR replaces the obsolete template test with a config test.

@KristjanESPERANTO
Copy link
Collaborator

I'm not entirely sure, but I think the tests might not properly validate variable substitution? 🤔

The current tests check that logLevel and ipWhitelist equal the defaults, but the .env values are set such that they produce exactly those defaults after substitution:

  • ["INFO", "LOG", "WARN", "ERROR"] = default
  • ["127.0.0.1", "::ffff:127.0.0.1", "::1"] = default

These tests would pass even if substitution was broken. A test for timeFormat would be better since it's the only value that differs from the default:

it("config.timeFormat should be 12 from MM_TIME_FORMAT variable", async () => {
    expect(config.timeFormat).toBe(12); // default is 24
});

This should better verify that substitution works. WDYT?

@KristjanESPERANTO
Copy link
Collaborator

By the way: I just wanted to say that I'm really excited that we can now hide the secrets from the front end 😃

@khassel
Copy link
Collaborator Author

khassel commented Feb 9, 2026

but I think the tests might not properly validate variable substitution?

they did. But I changed them now again so they are not testing against defaults.

If the variable substitution fails the bash variable remains in the config.

Examples:

	language: "${MM_LANGUAGE}",

So here the test will fail because "${MM_LANGUAGE}" not equals "de".

	timeFormat: ${MM_TIME_FORMAT},

Here loading the config would already fail when doing the config check.

@KristjanESPERANTO KristjanESPERANTO merged commit 6cb3e24 into MagicMirrorOrg:develop Feb 9, 2026
9 checks passed
@KristjanESPERANTO
Copy link
Collaborator

Nice solution 👍 🙂

@khassel
Copy link
Collaborator Author

khassel commented Feb 9, 2026

the failed workflow concerning release creation is AFAIS related to github problems (next PR will pickup this too, so no problem):

grafik

@khassel khassel deleted the var-test branch February 9, 2026 19:53
@KristjanESPERANTO
Copy link
Collaborator

I have recently noticed problems with github workflow in various repositories. I haven't been able to identify a clear pattern yet. Perhaps Microsoft is making internal changes.

@khassel
Copy link
Collaborator Author

khassel commented Feb 9, 2026

see https://www.githubstatus.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants