CI failing in master #85

Closed
opened 2026-02-28 18:48:08 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @TomAFrench on GitHub (May 7, 2022).

I've been trying to get CI working so I'm a little more certain I won't start breaking things when making more meaningful changes but it's currently failing in master.

The initial issue is that the patches aren't lining up with the actual installed packages so the install step fails. This is addressed in #53 and #55 which together allow us to progress to the test step.

The issue I'm running into now however is that several of the tests are failing:
image

Many of the failures are of the format:

// Example 1
Failed: Object {
      "message": "Cannot read property 'SYNC_SERVER' of null",
      "meta": undefined,
      "reason": undefined,
    }

// Example 2
TypeError: Cannot read property 'PLAID_SERVER' of null

implying that getServer() is returning null. Are these tests currently expected to fail or is this an artifact of code being copied over into the monorepo where some initialisation of the config is missing?

As a sidenote, could you set up circleCI to start tracking this repo?

Originally created by @TomAFrench on GitHub (May 7, 2022). I've been trying to get CI working so I'm a little more certain I won't start breaking things when making more meaningful changes but it's currently failing in master. The initial issue is that the patches aren't lining up with the actual installed packages so the `install` step fails. This is addressed in #53 and #55 which together allow us to progress to the `test` step. The issue I'm running into now however is that several of the tests are failing: ![image](https://user-images.githubusercontent.com/15848336/167266916-b4c8d4cf-0073-4b0f-b34a-84ee3c224cb2.png) Many of the failures are of the format: ``` // Example 1 Failed: Object { "message": "Cannot read property 'SYNC_SERVER' of null", "meta": undefined, "reason": undefined, } // Example 2 TypeError: Cannot read property 'PLAID_SERVER' of null ``` implying that [`getServer()`](https://github.com/actualbudget/actual/blob/b136c54fb6a71873b4393e35e2a5a69b0dda4f0c/packages/loot-core/src/server/server-config.js#L20) is returning `null`. Are these tests currently expected to fail or is this an artifact of code being copied over into the monorepo where some initialisation of the config is missing? As a sidenote, could you set up circleCI to start tracking this repo?
Author
Owner

@travisby commented on GitHub (May 13, 2022):

With your change from #53 and this patch:

From 92ce5bc8c8ba2c77c4ef412e0355d33df4843b92 Mon Sep 17 00:00:00 2001
From: Travis Beatty <travisby@gmail.com>
Date: Fri, 13 May 2022 08:29:18 -0400
Subject: [PATCH] Fix getServer under tests

---
 packages/loot-core/src/server/server-config.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/packages/loot-core/src/server/server-config.js b/packages/loot-core/src/server/server-config.js
index 1b9b64e..b74e687 100644
--- a/packages/loot-core/src/server/server-config.js
+++ b/packages/loot-core/src/server/server-config.js
@@ -18,13 +18,15 @@ export function setServer(url) {
 
 // `url` is optional; if not given it will provide the global config
 export function getServer(url) {
-  if (url) {
-    return {
-      BASE_SERVER: url,
-      SYNC_SERVER: joinURL(url, '/sync'),
-      SIGNUP_SERVER: joinURL(url, '/account'),
-      PLAID_SERVER: joinURL(url, '/plaid')
-    };
+  if (!url && config) {
+    return config;
   }
-  return config;
+
+  url = url ? url : "http://example.com/";
+  return {
+    BASE_SERVER: url,
+    SYNC_SERVER: joinURL(url, '/sync'),
+    SIGNUP_SERVER: joinURL(url, '/account'),
+    PLAID_SERVER: joinURL(url, '/plaid')
+  };
 }
-- 
2.30.2

I've reduced it down to

Test Suites: 4 failed, 1 skipped, 34 passed, 38 of 39 total
Tests:       7 failed, 3 skipped, 239 passed, 249 total

I don't think this is a real fix so I won't submit it, but this might reduce and let us fix the rest of the tests in the meantime.

@travisby commented on GitHub (May 13, 2022): With your change from #53 and this patch: ``` From 92ce5bc8c8ba2c77c4ef412e0355d33df4843b92 Mon Sep 17 00:00:00 2001 From: Travis Beatty <travisby@gmail.com> Date: Fri, 13 May 2022 08:29:18 -0400 Subject: [PATCH] Fix getServer under tests --- packages/loot-core/src/server/server-config.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/loot-core/src/server/server-config.js b/packages/loot-core/src/server/server-config.js index 1b9b64e..b74e687 100644 --- a/packages/loot-core/src/server/server-config.js +++ b/packages/loot-core/src/server/server-config.js @@ -18,13 +18,15 @@ export function setServer(url) { // `url` is optional; if not given it will provide the global config export function getServer(url) { - if (url) { - return { - BASE_SERVER: url, - SYNC_SERVER: joinURL(url, '/sync'), - SIGNUP_SERVER: joinURL(url, '/account'), - PLAID_SERVER: joinURL(url, '/plaid') - }; + if (!url && config) { + return config; } - return config; + + url = url ? url : "http://example.com/"; + return { + BASE_SERVER: url, + SYNC_SERVER: joinURL(url, '/sync'), + SIGNUP_SERVER: joinURL(url, '/account'), + PLAID_SERVER: joinURL(url, '/plaid') + }; } -- 2.30.2 ``` I've reduced it down to ``` Test Suites: 4 failed, 1 skipped, 34 passed, 38 of 39 total Tests: 7 failed, 3 skipped, 239 passed, 249 total ``` I don't think this is a real fix so I won't submit it, but this might reduce and let us fix the rest of the tests in the meantime.
Author
Owner

@MatissJanis commented on GitHub (Jan 12, 2023):

Done

@MatissJanis commented on GitHub (Jan 12, 2023): Done
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#85