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

Fixes for Frigg CI #313

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Fixes for Frigg CI #313

wants to merge 4 commits into from

Conversation

igorschechtel
Copy link
Contributor

The 'Frigg CI' workflow is currently failing, this PR is supposed to fix the errors

Copy link

sonarcloud bot commented May 27, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@igorschechtel
Copy link
Contributor Author

Hey @seanspeaks or @MichaelRyanWebber, I'm trying to make the CI pass. Do you have any idea why this test is failing?

FAIL module-plugin/test/auther.test.js
  ● HubSpot Module Tests › Test credential retrieval and module instantiation › retrieve by entity id

    TypeError: Cannot read properties of null (reading 'credential')

      113 |                 params.credentialId
      114 |             );
    > 115 |         }
          |          ^
      116 |         let credential = {};
      117 |         let entity = {};
      118 |         if (instance.credential) {

@igorschechtel igorschechtel marked this pull request as draft May 29, 2024 22:51
@MichaelRyanWebber
Copy link
Contributor

MichaelRyanWebber commented May 29, 2024

@igorschechtel I wonder if perhaps the in-memory mongo is not working in CI. It's passing for me when I run it (thanks to your fixes to the imports), is that the same for you?

Mm, on second thought, if the packages/core/integrations/test/integration-base.test.js is passing, that also is using Mongo.

Looking more closely it must be failing on line 108 in auther.js

instance.credential = await instance.CredentialModel.findById( instance.entity.credential );

which just means it's not finding the entity in the previous line. My first thought is that there is a version mismatch in the CI environement around mongo or mongoose, but it could be something else.

Naively, if I were troubleshooting I'd try to log out the params being passed in, to start.

@igorschechtel
Copy link
Contributor Author

@MichaelRyanWebber yes, this test is also passing when I run it locally.

It seems to me that the issue is that instance is null. So when it tries to access instance.credential we get the error:

TypeError: Cannot read properties of null (reading 'credential')

If this is true I think the origin for the error is line 105:

const instance = new this(params);

Not sure why this would return null though... maybe an error in the constructor? The fact that it passes locally but not in the workflow makes it even weirder.

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