mattermost / mattermost-plugin-github

GitHub plugin for Mattermost
Apache License 2.0
157 stars 148 forks source link

Adopt memorystore for tests #745

Closed hanzei closed 6 months ago

hanzei commented 6 months ago

Summary

This PR adopts the MemoryStore (https://github.com/mattermost/mattermost/pull/26244) from the tests in server/plugin/subscriptions_test.go and removes the mocks.

I've included a cleanup of p.API usage via 3f0f4fc4d0f33e8d57b99301a0df078286d30663 in this PR.

Ticket Link

None

hanzei commented 6 months ago

@mickmister @raghavaggarwal2308 Gentle reminder to review the PR

hanzei commented 6 months ago

I've reached out to @ayusht2810 regarding the failing CI in https://community.mattermost.com/core/pl/z7833z1f6iyaibmib4af13fzar

raghavaggarwal2308 commented 6 months ago

I've reached out to @ayusht2810 regarding the failing CI in https://community.mattermost.com/core/pl/z7833z1f6iyaibmib4af13fzar

@hanzei The tests are working fine on my local for master and your branch as well. Can you please try re-running the CI here?

hanzei commented 6 months ago

@raghavaggarwal2308 I've re-triggered CI, which fixed the issue.

Please note that the tests on master also fail. It seems like we have a flaky test there.

hanzei commented 6 months ago

Ok, master is also green now. Seems like the issue is fixed :shrug:

hanzei commented 6 months ago

@raghavaggarwal2308 @mickmister Do you think adopting the memory store would be helpful for other plugins that extensively make use of the KV store like Gitlab or JIRA?

hanzei commented 6 months ago

@raghavaggarwal2308 The nightly run failed again: https://github.com/mattermost/mattermost-plugin-github/actions/runs/8164766247/job/22320677668

Kshitij-Katiyar commented 5 months ago

@raghavaggarwal2308 The nightly run failed again: https://github.com/mattermost/mattermost-plugin-github/actions/runs/8164766247/job/22320677668

@hanzei I tried running the commands locally many times but was not really able to reproduce this. Screenshot from 2024-03-19 18-49-21

hanzei commented 5 months ago

My own tests were the ones that were flaky. :facepalm: Submitted https://github.com/mattermost/mattermost-plugin-starter-template/pull/197.