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

Fix Classic Tests in Frodo-CLI #425

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

phalestrivir
Copy link
Contributor

This PR updates the config export/import tests for classic deployments so that they pass again, resolving issue #423. A PR in Frodo-Lib (of the same name as this PR) makes the appropriate changes to how mocks are generated/matched to allow the tests to pass consistently.

Additionally, an update was made to agent exports since I ran into a test failure due to a race condition where a file from the agent exports test conflicted with a file in the agent web exports test, so the fix should prevent that from happening again in the future.

@vscheuber
Copy link
Contributor

@phalestrivir the tests are still failing for me even after pointing this PR to the new frodo-lib release 2.0.1-0. Would you mind taking a look?

If you figure out what's going on (or even to test if it's also happening inside the pipeline) you can add an updated package.json to your PR, which references the updated frodo-lib.

4 of the config-export tests are failing:

% npm test config-export

> @rockcarver/[email protected] test
> npm run test:only config-export


> @rockcarver/[email protected] test:only
> NODE_OPTIONS='--no-warnings --experimental-vm-modules' npx jest --silent config-export

 PASS  test/client_cli/en/config-export.test.js
 FAIL  test/e2e/config-export.e2e.test.js (19.289 s)
  ● frodo config export › "frodo config export -adND exportAllTestDir6 -m classic": should export everything, including default scripts, to a single file

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

    Expected: 1
    Received: 0

      71 |     // if (filePaths.length !== 0)
      72 |     //   console.error(`filePaths:\n${filePaths.join('\n')}`);
    > 73 |     expect(filePaths.length).toBe(1);
         |                              ^
      74 |   } else {
      75 |     expect(filePaths.length >= 1).toBeTruthy();
      76 |   }

      at toBe (test/e2e/utils/TestUtils.js:73:30)
      at Object.<anonymous> (test/e2e/config-export.e2e.test.js:115:5)

  ● frodo config export › "frodo config export --all --file testExportAll2.json --include-active-values --use-string-arrays --no-decode --no-coords --type classic": should export everything to a single file named testExportAll2.json with no decoding variables, no journey coordinates, and using string arrays

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

    Expected: 1
    Received: 0

      71 |     // if (filePaths.length !== 0)
      72 |     //   console.error(`filePaths:\n${filePaths.join('\n')}`);
    > 73 |     expect(filePaths.length).toBe(1);
         |                              ^
      74 |   } else {
      75 |     expect(filePaths.length >= 1).toBeTruthy();
      76 |   }

      at toBe (test/e2e/utils/TestUtils.js:73:30)
      at Object.<anonymous> (test/e2e/config-export.e2e.test.js:121:5)

  ● frodo config export › "frodo config export -AsxD exportAllTestDir7 -m classic": should export everything into separate files in the directory exportAllTestDir7 with scripts extracted and mappings separate

    expect(received).toBeTruthy()

    Received: false

      73 |     expect(filePaths.length).toBe(1);
      74 |   } else {
    > 75 |     expect(filePaths.length >= 1).toBeTruthy();
         |                                   ^
      76 |   }
      77 |   expect(removeAnsiEscapeCodes(stdout)).toMatchSnapshot();
      78 |   if (checkStderr) expect(removeAnsiEscapeCodes(stderr)).toMatchSnapshot();

      at toBeTruthy (test/e2e/utils/TestUtils.js:75:35)
      at Object.<anonymous> (test/e2e/config-export.e2e.test.js:127:5)

  ● frodo config export › "frodo config export --all-separate --no-metadata --default --directory exportAllTestDir8 --include-active-values --use-string-arrays --no-decode --no-coords --type classic": should export everything, including default scripts, into separate files in the directory exportAllTestDir8 with scripts extracted, no decoding variables, no journey coordinates, separate mappings, and using string arrays

    expect(received).toBeTruthy()

    Received: false

      73 |     expect(filePaths.length).toBe(1);
      74 |   } else {
    > 75 |     expect(filePaths.length >= 1).toBeTruthy();
         |                                   ^
      76 |   }
      77 |   expect(removeAnsiEscapeCodes(stdout)).toMatchSnapshot();
      78 |   if (checkStderr) expect(removeAnsiEscapeCodes(stderr)).toMatchSnapshot();

      at toBeTruthy (test/e2e/utils/TestUtils.js:75:35)
      at Object.<anonymous> (test/e2e/config-export.e2e.test.js:140:5)
...
Test Suites: 1 failed, 1 passed, 2 total
Tests:       4 failed, 7 passed, 11 total
Snapshots:   371 obsolete, 1319 passed, 1319 total
Time:        20.813 s, estimated 47 s
%

2 of the config-import tests are failing:

% npm test config-import

> @rockcarver/[email protected] test
> npm run test:only config-import


> @rockcarver/[email protected] test:only
> NODE_OPTIONS='--no-warnings --experimental-vm-modules' npx jest --silent config-import

 PASS  test/client_cli/en/config-import.test.js
 FAIL  test/e2e/config-import.e2e.test.js (18.098 s)
  ● frodo config import › "frodo config import -adf test/e2e/exports/all/all.config.json -m classic" Import everything from "all.config.json", including default scripts.

    expect(received).toMatchSnapshot()

    Snapshot name: `frodo config import "frodo config import -adf test/e2e/exports/all/all.config.json -m classic" Import everything from "all.config.json", including default scripts. 1`

    Snapshot: "Connected to http://openam-frodo-dev.classic.com:8080/am [/] as user amAdmin
    Errors occurred during full config import
      Error importing services
      Error putting global full service configs
      Error putting realm full service config CorsService
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Resource 'CorsService' not found
      Error putting global full service config dashboard
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 400
        Reason: Bad Request
        Message: Invalid attribute specified.
        Detail: [object Object]
      Error importing scripts
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error reading authentication settings
      Error updating authentication settings
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agents
      Error importing agent cdsso-ig-agent of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-ig-agent of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-ig-agent2 of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-java-agent of type J2EEAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-java-agent2 of type J2EEAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-web-agent of type WebAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-web-agent2 of type WebAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent ig-agent of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing resource types
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing circles of trust
      Error reading saml2 entity ids
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing services
      Error putting realm full service configs
      Error putting realm full service config SocialIdentityProviders
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config baseurl
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config oauth-oidc
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config pingOneWorkerService
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config policyconfiguration
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config selfServiceTrees
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config session
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config validation
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing saml2 providers
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing providers
      Error importing oauth2 clients
      Error updating oauth2 client 0b48992b-a2dd-4ed5-8b07-1fc5d7306da8
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client 49a2981c-e192-4739-a0e6-c7582168bdf5
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client 60b7b032-68fc-45ed-98ca-262c1985fb7e
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client EncoreRCSClient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client EncoreWindowsRCSClient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client RCSClient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-ciba
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-device
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-ios-sdk
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-web
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client da190d6b-0fcc-42aa-b890-0cef7486e6d4
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client hrlite-client
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client rfc7523-client1
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client test2
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client testapp
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client testclient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing policy sets
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing policies
      Error updating policy FeatureStorePolicy
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy HR-webapp
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy Test Policy
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy actions
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy activity
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy apply
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error reading journeys
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
    "
    Received: undefined

      180 |       // parallel test execution alters the progress bar output causing the snapshot to mismatch.
      181 |       // only workable solution I could find was to remove progress bar output altogether from such tests.
    > 182 |       expect(removeProgressBarOutput(removeAnsiEscapeCodes(e.stderr))).toMatchSnapshot();
          |                                                                        ^
      183 |     }
      184 |   });
      185 |

      at Object.toMatchSnapshot (test/e2e/config-import.e2e.test.js:182:72)

  ● frodo config import › "frodo config import -AdD test/e2e/exports/all-separate/everything -m classic" Import everything from directory "test/e2e/exports/all-separate/everything"

    expect(received).toMatchSnapshot()

    Snapshot name: `frodo config import "frodo config import -AdD test/e2e/exports/all-separate/everything -m classic" Import everything from directory "test/e2e/exports/all-separate/everything" 1`

    Snapshot: "Connected to http://openam-frodo-dev.classic.com:8080/am [/] as user amAdmin
    Errors occurred during full config import
      Error importing services
      Error putting global full service configs
      Error putting realm full service config CorsService
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Resource 'CorsService' not found
      Error putting global full service config dashboard
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 400
        Reason: Bad Request
        Message: Invalid attribute specified.
        Detail: [object Object]
      Error importing scripts
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating script
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error reading authentication settings
      Error updating authentication settings
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agents
      Error importing agent cdsso-ig-agent of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-ig-agent of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-ig-agent2 of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-java-agent of type J2EEAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-java-agent2 of type J2EEAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-web-agent of type WebAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent frodo-test-web-agent2 of type WebAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing agent ig-agent of type IdentityGatewayAgent
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing resource types
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing circles of trust
      Error reading saml2 entity ids
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing services
      Error putting realm full service configs
      Error putting realm full service config SocialIdentityProviders
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config baseurl
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config oauth-oidc
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config pingOneWorkerService
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config policyconfiguration
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config selfServiceTrees
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config session
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error putting realm full service config validation
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing saml2 providers
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing providers
      Error importing oauth2 clients
      Error updating oauth2 client 0b48992b-a2dd-4ed5-8b07-1fc5d7306da8
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client 49a2981c-e192-4739-a0e6-c7582168bdf5
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client 60b7b032-68fc-45ed-98ca-262c1985fb7e
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client EncoreRCSClient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client EncoreWindowsRCSClient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client RCSClient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-ciba
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-device
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-ios-sdk
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client baseline-web
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client da190d6b-0fcc-42aa-b890-0cef7486e6d4
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client hrlite-client
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client rfc7523-client1
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client test2
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client testapp
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating oauth2 client testclient
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing policy sets
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error importing policies
      Error updating policy FeatureStorePolicy
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy HR-webapp
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy Test Policy
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy actions
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy activity
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error updating policy apply
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
      Error reading journeys
      HTTP client error
        Code: ERR_BAD_REQUEST
        Status: 404
        Reason: Not Found
        Message: Realm not found
    "
    Received: undefined

      199 |       // parallel test execution alters the progress bar output causing the snapshot to mismatch.
      200 |       // only workable solution I could find was to remove progress bar output altogether from such tests.
    > 201 |       expect(removeProgressBarOutput(removeAnsiEscapeCodes(e.stderr))).toMatchSnapshot();
          |                                                                        ^
      202 |     }
      203 |   });
      204 |

      at Object.toMatchSnapshot (test/e2e/config-import.e2e.test.js:201:72)

 › 2 snapshots failed.
Snapshot Summary
 › 2 snapshots failed from 1 test suite. Inspect your code changes or run `npm run npx -- -u` to update them.

Test Suites: 1 failed, 1 passed, 2 total
Tests:       2 failed, 4 skipped, 7 passed, 13 total
Snapshots:   2 failed, 7 passed, 9 total
Time:        18.36 s, estimated 41 s
%

@phalestrivir
Copy link
Contributor Author

Sorry about that, I'm working on fixing it. The problem is that the token expires after about 30 minutes or so, so the tests start failing once that happens. I thought I fixed it by requiring it to request a new token each time the test is run (using the FRODO_NO_CACHE env) so it can utilize the mocks each time, although it appears that since the mocks have an old expiry time for the tokens that it causes the tests to still fail once they expire. I'm looking into how to intercept the request so I can make the token so it never expires, so once I fix it I will update the PR (and make a new one for frodo-lib if necessary).

@phalestrivir
Copy link
Contributor Author

@vscheuber I made a PR in frodo-lib that fixes it. I removed the FRODO_NO_CACHE stuff I added in this PR since it is no longer needed as well.

@vscheuber
Copy link
Contributor

@phalestrivir the same tests are still failing. I'm gonna look into it some more but I merged your PR in frodo-lib and I pulled down the latest changes into my local env and I pulled down this CLI PR and the tests still don't run. Would you mind taking another close look and see if your tests still succeed? The failures look the same on first glance.

@phalestrivir
Copy link
Contributor Author

phalestrivir commented Jul 26, 2024

@phalestrivir the same tests are still failing. I'm gonna look into it some more but I merged your PR in frodo-lib and I pulled down the latest changes into my local env and I pulled down this CLI PR and the tests still don't run. Would you mind taking another close look and see if your tests still succeed? The failures look the same on first glance.

@vscheuber I updated everything on my end, re-built, re-ran all the tests and they are all still passing for me. However, I tried deleting my connection profile to my classic deployment I was using for testing and re-running the tests and now they're failing with what I'd assume to be the errors you are getting. Adding the connection profile back made the tests pass again. I didn't even think to try running the tests without the connection profile until now, however I'm not sure how to get the tests passing without it. Do you have any ideas on how to do that?

Edit: I thought of an idea to set the FRODO_CONNECTION_PROFILES_PATH to the test/env/Connections.json file, and just put the connection profile there, so I went ahead and updated the PR with the changes. If you can think of another better way to do it then feel free to change it.

…o prevent conflicts with other agent export tests.
@phalestrivir
Copy link
Contributor Author

@vscheuber It seems the pipeline is still failing, I'm not sure why. The tests are still passing for me in my local environment, even after deleting the connection profile. I'm not sure what else is going on. Are you able to get them passing in your local environment now with the new changes?

@vscheuber vscheuber merged commit dca5ddf into rockcarver:main Jul 27, 2024
8 of 11 checks passed
@vscheuber
Copy link
Contributor

vscheuber commented Jul 27, 2024

@phalestrivir @hfranklin It clicked for me when you mentioned that you could dupe the issue after removing your connection profile. Our regular tests do not rely on connection profiles so I looked at our TestUtils.getEnv() method and found the issue. This commit has the change I made to TestUtils plus me undoing the connection profiles changes you made to fix the failures.

With that change I got the tests to reliably run and pass locally but hit a timeout issue with two of the import tests when running them in node18 in the pipeline. So I had to do another commit to add a timeout to allow them to pass on node18.

Those two things I believe (on top of all your changes) put the issue to rest for good (knocking on wood).

@phalestrivir phalestrivir deleted the bugfix/fix-classic-tests branch August 16, 2024 18:13
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