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

one calendar test fails since today #3291

Closed
khassel opened this issue Dec 13, 2023 · 7 comments
Closed

one calendar test fails since today #3291

khassel opened this issue Dec 13, 2023 · 7 comments
Labels

Comments

@khassel
Copy link
Collaborator

khassel commented Dec 13, 2023

  ● Calendar module › exdate check › should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toHaveLength(expected)·
    Expected length: 51
    Received length: 50
    Received object: [<tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Dec 20th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Dec 27th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 3rd</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 10th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 17th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 24th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 31st</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Feb 7th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Feb 14th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Feb 21st</td></tr>, …]]

       95 |
       96 |             it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => {
    >  97 |                     await expect(testElementLength(".calendar .event", 51)).resolves.toBe(true);
          |                           ^
       98 |             });
       99 |     });
      100 |

      at expect (node_modules/expect/build/index.js:113:15)
      at Object.expect (tests/e2e/modules/calendar_spec.js:97:10)

I was able to fake the date in my test container:

  • running with a date before today: test succeeds
  • running with a date of today or later: test fails

I think this has something to do with the data used in tests/mocks/calendar_test_exdate.ics.

So I think we should remove the test until someone has an idea to fix it.

@khassel khassel added the bug label Dec 13, 2023
@rejas
Copy link
Collaborator

rejas commented Dec 14, 2023

maybe the original author @jkriegshauser can help us out witrh a fix?

@jkriegshauser
Copy link
Contributor

@rejas I'll try to take a look when i get some time. I've noticed issues since Los_Angeles timezone went off DST. I still highly suspect the rrule js module since there are hacks around making it work.

@khassel
Copy link
Collaborator Author

khassel commented Dec 15, 2023

Digging into this it seems the test still depends on the timezone used.

With setting the timezone to UTC before running the tests it seems to work. Will provide a PR and we will see if this fix is sufficent.

rejas pushed a commit that referenced this issue Dec 17, 2023
@rejas rejas closed this as completed Dec 17, 2023
MichMich added a commit that referenced this issue Jan 1, 2024
## [2.26.0] - 01-01-2024

Thanks to: @bnitkin, @bugsounet, @dependabot, @jkriegshauser,
@kaennchenstruggle, @KristjanESPERANTO and @Ybbet.

Special thanks to @khassel, @rejas and @sdetweil for taking over most
(if not all) of the work on this release as project collaborators. This
version would not be there without their effort. Thank you guys! You are
awesome!

This release also marks the latest release by Michael Teeuw. For more
info, please read the following post: [A New Chapter for MagicMirror:
The Community Takes the
Lead](https://forum.magicmirror.builders/topic/18329/a-new-chapter-for-magicmirror-the-community-takes-the-lead).

### Added

- Added update notification updater (for 3rd party modules)
- Added node 21 to the test matrix
- Added transform object to calendar:customEvents
- Added ESLint rules for jest (including jest/expect-expect and
jest/no-done-callback)

### Removed

- Removed Codecov workflow (not working anymore, other workflow
required) (#3107)
- Removed titleReplace from calendar, replaced + extended by
customEvents (backward compatibility included) (#3249)
- Removed failing unit test (#3254)
- Removed some unused variables

### Updated

- Update electron to v27 and update other dependencies as well as github
actions
- Update newsfeed: Use `html-to-text` instead of regex for transform
description
- Review ESLint config (#3269)
- Updated dependencies
- Clock module: optionally display current moon phase in addition to
rise/set times
- electron is now per default started without gpu, if needed it must be
enabled with new env var `ELECTRON_ENABLE_GPU=1` on startup (#3226)
- Replace prettier by stylistic in ESLint config to lint JavaScript (and
disable some rules for `config/config.js*` files)
- Update node-ical to v0.17.1 and fix tests

### Fixed

- Avoid fade out/in on updateDom when many calendars are used
- Fix the option eventClass on customEvents.
- Fix yr API version in locationforecast and sunrise call (#3227)
- Fix cloneObject() function to respect RegExp (#3237)
- Fix newsfeed module for feeds using "a10:updated" tag (#3238)
- Fix issue template (#3167)
- Fix #3256 filter out bad results from rrule.between
- Fix calendar events sometimes not respecting deleted events (#3250)
- Fix electron loadurl locally on Windows when address "0.0.0.0" (#2550)
- Fix updatanotification (update_helper.js): catch error if reponse is
not an JSON format (check PM2)
- Fix missing typeof in calendar module
- Fix style issues after prettier update
- Fix calendar test (#3291) by moving "Exdate check" from e2e to
electron to run on a Thursday
- Fix calendar config params `fetchInterval` and `excludedEvents` were
never used from single calendar config (#3297)
- Fix MM_PORT variable not used in electron and allow full path for
MM_CONFIG_FILE variable (#3302)

---------

Signed-off-by: naveen <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Karsten Hassel <[email protected]>
Co-authored-by: Malte Hallström <[email protected]>
Co-authored-by: Veeck <[email protected]>
Co-authored-by: veeck <[email protected]>
Co-authored-by: dWoolridge <[email protected]>
Co-authored-by: Johan <[email protected]>
Co-authored-by: Dario Mratovich <[email protected]>
Co-authored-by: Dario Mratovich <[email protected]>
Co-authored-by: Magnus <[email protected]>
Co-authored-by: Naveen <[email protected]>
Co-authored-by: buxxi <[email protected]>
Co-authored-by: Thomas Hirschberger <[email protected]>
Co-authored-by: Kristjan ESPERANTO <[email protected]>
Co-authored-by: Andrés Vanegas Jiménez <[email protected]>
Co-authored-by: Dave Child <[email protected]>
Co-authored-by: grenagit <[email protected]>
Co-authored-by: Grena <[email protected]>
Co-authored-by: Magnus Marthinsen <[email protected]>
Co-authored-by: Patrick <[email protected]>
Co-authored-by: Piotr Rajnisz <[email protected]>
Co-authored-by: Suthep Yonphimai <[email protected]>
Co-authored-by: CarJem Generations (Carter Wallace) <[email protected]>
Co-authored-by: Nicholas Fogal <[email protected]>
Co-authored-by: JakeBinney <[email protected]>
Co-authored-by: OWL4C <[email protected]>
Co-authored-by: Oscar Björkman <[email protected]>
Co-authored-by: Ismar Slomic <[email protected]>
Co-authored-by: Jørgen Veum-Wahlberg <[email protected]>
Co-authored-by: Eddie Hung <[email protected]>
Co-authored-by: Bugsounet - Cédric <[email protected]>
Co-authored-by: bugsounet <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Knapoc <[email protected]>
Co-authored-by: sam detweiler <[email protected]>
Co-authored-by: veeck <[email protected]>
Co-authored-by: Paranoid93 <[email protected]>
Co-authored-by: NolanKingdon <[email protected]>
Co-authored-by: J. Kenzal Hunter <[email protected]>
Co-authored-by: Teddy <[email protected]>
Co-authored-by: TeddyStarinvest <[email protected]>
Co-authored-by: martingron <[email protected]>
Co-authored-by: dgoth <[email protected]>
Co-authored-by: kaennchenstruggle <[email protected]>
Co-authored-by: jkriegshauser <[email protected]>
Co-authored-by: Ben Nitkin <[email protected]>
@khassel
Copy link
Collaborator Author

khassel commented Jan 3, 2024

this test still fails sometimes, seems to be time dependent

FAIL tests/electron/modules/calendar_spec.js (12.048 s)
  ● Calendar module › Exdate check › should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period

    expect(received).toBe(expected) // Object.is equality

    Expected: 51
    Received: 50

      55 | 			expect(elem).not.toBeNull();
      56 | 			const cnt = await loc.count();
    > 57 | 			expect(cnt).toBe(51);
         | 			            ^
      58 | 		});
      59 | 	});
      60 | });

      at Object.toBe (tests/electron/modules/calendar_spec.js:57:16)

@jkriegshauser
Copy link
Contributor

Yep, something is still funky in the latest release. I had an event show up on MM today that was deleted (in exdate). I'll look into it

@jc43081
Copy link

jc43081 commented Jan 7, 2024

I am not sure this is related, but it would seem to fit the failure. I am seeing two different recurring meetings where I have events listed for all future dates, but not the original date. For example, I have an event set to recur every 2nd Wednesday starting January 10th. I don't see it on the 10th, but I do see it on all subsequent 2nd Wednesdays through the rest of the year.

@jkriegshauser
Copy link
Contributor

jkriegshauser commented Jan 7, 2024 via email

rejas pushed a commit that referenced this issue Jan 27, 2024
* Worked around several issues in the RRULE library that were causing
deleted calender events to still show, some initial and recurring events
to not show, and some event times to be off an hour. (#3291)
* Renamed variables in *calendarfetcherutils.js* to be more clear about
use of `moment` and js's `Date` class.
* Added calendar config option `forceUseCurrentTime` (default:`false`)
which will ignore overridden `Date.now` in the config in order to keep
some tests consistent.
* Added several unit tests for crossing DST in different timezones with
excluded events.
@khassel khassel closed this as completed Mar 27, 2024
@rejas rejas mentioned this issue Apr 1, 2024
rejas added a commit that referenced this issue Apr 1, 2024
## [2.27.0] - 2024-04-01

Thanks to: @bugsounet, @crazyscot, @illimarkangur, @jkriegshauser,
@khassel, @KristjanESPERANTO, @Paranoid93, @rejas, @sdetweil and
@vppencilsharpener.

This release marks the first release without Michael Teeuw (@MichMich).
A very special thanks to him for creating MagicMirror and leading the
project for so many years.

For more info, please read the following post: [A New Chapter for
MagicMirror: The Community Takes the
Lead](https://forum.magicmirror.builders/topic/18329/a-new-chapter-for-magicmirror-the-community-takes-the-lead).

### Added

- Output of system information to the console for troubleshooting (#3328
and #3337), ignore errors under aarch64 (#3349)
- [chore] Add `eslint-plugin-package-json` to lint the `package.json`
files (#3368)
- [weather] `showHumidity` config is now a string describing where to
show this element. Supported values: "wind", "temp", "feelslike",
"below", "none". (#3330)
- electron-rebuild test suite for electron and 3rd party modules
compatibility (#3392)
- Create MM² icon and attach it to electron process (#3407)

### Updated

- Update updatenotification (update_helper.js): Recode with pm2 library
(#3332)
- Removing lodash dependency by replacing merge by spread operator
(#3339)
- Use node prefix for build-in modules (#3340)
- Rework logging colors (#3350)
- Update pm2 to v5.3.1 with no allow-ghsas (#3364)
- [chore] Update husky and let lint-staged fix ESLint issues
- [chore] Update dependencies including electron to v29 (#3357) and
node-ical
- Update translations for estonian (#3371)
- Update electron to v29 and update other dependencies
- [calendar] fullDay events over several days now show the left days
from the first day on and 'today' on the last day
- Update layout of current weather indoor values

### Fixed

- Correct apibase of weathergov weatherprovider to match documentation
(#2926)
- Worked around several issues in the RRULE library that were causing
deleted calender events to still show, some
initial and recurring events to not show, and some event times to be off
an hour. (#3291)
- Skip changelog requirement when running tests for dependency updates
(#3320)
- Display precipitation probability when it is 0% instead of blank/empty
(#3345)
- [newsfeed] Suppress unsightly animation cases when there are 0 or 1
active news items (#3336)
- [newsfeed] Always compute the feed item URL using the same helper
function (#3336)
- Ignore all custom css files (#3359)
- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361)
- Changed `log.debug` to `log.log` in `app.js` where logLevel is not set
because config is not loaded at this time (#3353)
- [calendar] deny fetch interval < 60000 and set 60000 in this case
(prevent fetch loop failed) (#3382)
- added message in case where config.js is missing the module.export
line PR #3383
- Fixed an issue where recurring events could extend past their
recurrence end date (#3393)
- Don't display any `npm WARN <....>` on install (#3399)
- Fixed move suncalc dependency to production from dev, as it is used by
clock module
- [compliments] Fix mirror not responding anymore when no compliments
are to be shown (#3385)

### Deleted

- Unneeded file headers (#3358)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Michael Teeuw <[email protected]>
Co-authored-by: Kristjan ESPERANTO <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Karsten Hassel <[email protected]>
Co-authored-by: Ross Younger <[email protected]>
Co-authored-by: Bugsounet - Cédric <[email protected]>
Co-authored-by: jkriegshauser <[email protected]>
Co-authored-by: illimarkangur <[email protected]>
Co-authored-by: sam detweiler <[email protected]>
Co-authored-by: vppencilsharpener <[email protected]>
Co-authored-by: Paranoid93 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants