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

[BUG] Failed 2% of Apex Tests after self-signed certificate step #198

Open
jimenezXian opened this issue Sep 28, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jimenezXian
Copy link

Hey everyone,
I was executing the Apex Tests after generating the self-signed certificate and ended with 10 test failures. Unsure how to resolve these/ if I'm missing a step. Looking for guidance if anyone has encountered this before. Previous steps have been verified valid true along the guide. Working with another 3rd party team on the commerce side, I can only trust that the OCAPI shop/data configuration was done well.

  • Node version (node -v): 16.17.0

  • NPM version (npm -v): 8.15.0

  • SFDX version (sfdx -v): sfdx-cli/7.169.1 darwin-x64 node-v16.17.0

  • Salesforce Core version: 56
    Test errors:
    {

     "StackTrace": "Class.B2CProcessContact_ServiceEntry_Test.testResolveContactCustomerIDSuccess: line 300, column 1",
     "Message": "System.AssertException: Assertion Failed: Expected a parentAccount to be resolved",
     "MethodName": "testResolveContactCustomerIDSuccess",
     "Outcome": "Fail",
     "ApexClass": {
       "Name": "B2CProcessContact_ServiceEntry_Test",
       "NamespacePrefix": null
     },
     "RunTime": 4082,
     "FullName": "B2CProcessContact_ServiceEntry_Test.testResolveContactCustomerIDSuccess"
    

    },
    {

     "StackTrace": "Class.TestDataFactory_Test.createSObjectTest11: line 191, column 1",
     "Message": "System.AssertException: Assertion Failed",
     "MethodName": "createSObjectTest11",
     "Outcome": "Fail",
     "ApexClass": {
       "Name": "TestDataFactory_Test",
       "NamespacePrefix": null
     },
     "RunTime": 570,
     "FullName": "TestDataFactory_Test.createSObjectTest11"
    

    },
    {

     "StackTrace": "Class.TestDataFactory.SObjectManager: line 391, column 1\nClass.TestDataFactory.SObjectManager.insertAll: line 312, column 1\nClass.TestDataFactory.SObjectFactory: line 475, column 1\nClass.TestDataFactory: line 159, column 1\nClass.TestDataFactory: line 101, column 1\nClass.TestDataFactory_Test.createSObjectTest4: line 65, column 1",
     "Message": "TestDataFactory.TestDataFactoryException: Unable to insert \"Case\" records: \nCANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Case Create” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: INVALID_CROSS_REFERENCE_KEY: invalid cross reference id. You can look up ExceptionCode values in the SOAP API Developer Guide.: invalid cross reference id. You can look up ExceptionCode values in the SOAP API Developer Guide. []",
     "MethodName": "createSObjectTest4",
     "Outcome": "Fail",
     "ApexClass": {
       "Name": "TestDataFactory_Test",
       "NamespacePrefix": null
     },
     "RunTime": 3409,
     "FullName": "TestDataFactory_Test.createSObjectTest4"
    

    },
    {
    "StackTrace": "Class.QueryTest.fieldSettingTest: line 1208, column 1",
    "Message": "System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Account.Rating",
    "MethodName": "fieldSettingTest",
    "Outcome": "Fail",
    "ApexClass": {
    "Name": "QueryTest",
    "NamespacePrefix": null
    },
    "RunTime": 1161,
    "FullName": "QueryTest.fieldSettingTest"
    },
    {
    "StackTrace": "Class.QueryTest.assertOpportunity: line 1291, column 1\nClass.QueryTest.readableParentFieldsTest: line 202, column 1",
    "Message": "System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Opportunity.TotalOpportunityQuantity",
    "MethodName": "readableParentFieldsTest",
    "Outcome": "Fail",
    "ApexClass": {
    "Name": "QueryTest",
    "NamespacePrefix": null
    },
    "RunTime": 2100,
    "FullName": "QueryTest.readableParentFieldsTest"
    },
    {

     "StackTrace": "Class.QueryTest.assertAccount: line 1281, column 1\nClass.QueryTest.selectAllFieldsTest: line 83, column 1",
     "Message": "System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Account.Sic",
    
     "MethodName": "selectAllFieldsTest",
     "Outcome": "Fail",
     "ApexClass": {
       "Name": "QueryTest",
       "NamespacePrefix": null
     },
     "RunTime": 1617,
     "FullName": "QueryTest.selectAllFieldsTest"
    

    },
    {
    "StackTrace": "Class.QueryTest.assertAccount: line 1281, column 1\nClass.QueryTest.selectReadableFieldsTest: line 53, column 1",
    "Message": "System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Account.Sic",
    "MethodName": "selectReadableFieldsTest",
    "Outcome": "Fail",
    "ApexClass": {
    "Name": "QueryTest",
    "NamespacePrefix": null
    },
    "RunTime": 1189,
    "FullName": "QueryTest.selectReadableFieldsTest"
    },
    {
    "StackTrace": "Class.B2CIACustomerResolution_TestHelper.validateSingleResult: line 143, column 1\nClass.B2CIACustomerResolution_Test.testResolveByB2CCustomerIDNoCListSingleResult: line 158, column 1",
    "Message": "System.AssertException: Assertion Failed: Expected the customerResolution class to return at least one (1) record",
    "MethodName": "testResolveByB2CCustomerIDNoCListSingleResult",
    "Outcome": "Fail",
    "ApexClass": {
    "Name": "B2CIACustomerResolution_Test",
    "NamespacePrefix": null
    },
    "RunTime": 4770,
    "FullName": "B2CIACustomerResolution_Test.testResolveByB2CCustomerIDNoCListSingleResult"
    },
    {

     "StackTrace": "Class.B2CIACustomerResolution_TestHelper.validateSingleResult: line 143, column 1\nClass.B2CIACustomerResolution_Test.testResolveByB2CCustomerIDSingleResult: line 210, column 1",
     "Message": "System.AssertException: Assertion Failed: Expected the customerResolution class to return at least one (1) record",
     "MethodName": "testResolveByB2CCustomerIDSingleResult",
     "Outcome": "Fail",
     "ApexClass": {
       "Name": "B2CIACustomerResolution_Test",
       "NamespacePrefix": null
     },
     "RunTime": 922,
     "FullName": "B2CIACustomerResolution_Test.testResolveByB2CCustomerIDSingleResult"
    

    },
    {
    "StackTrace": "Class.B2CIACustomerResolution_TestHelper.validateSingleResult: line 143, column 1\nClass.B2CIACustomerResolution_Test.testResolveByB2CCustomerIDSingleResultFromMultiple: line 270, column 1",
    "Message": "System.AssertException: Assertion Failed: Expected the customerResolution class to return at least one (1) record",
    "MethodName": "testResolveByB2CCustomerIDSingleResultFromMultiple",
    "Outcome": "Fail",
    "ApexClass": {
    "Name": "B2CIACustomerResolution_Test",
    "NamespacePrefix": null
    },
    "RunTime": 2272,
    "FullName": "B2CIACustomerResolution_Test.testResolveByB2CCustomerIDSingleResultFromMultiple"
    },

@jimenezXian jimenezXian added the bug Something isn't working label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant