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

Wes/sync #2

Merged
merged 57 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
68be7d6
Removing mx stuff
tphalp Oct 21, 2024
809bf53
WIP: commit to switch branches
tphalp Oct 22, 2024
f3b4fb4
Merge branch 'main' into tysn/remove-mx-adapter-UCP-377
tphalp Oct 24, 2024
4d9ef55
Remove some more
tphalp Oct 25, 2024
27ae61d
WIP: Working on fixing unit tests
tphalp Oct 29, 2024
3be508f
Merge branch 'main' into tysn/remove-mx-adapter-UCP-377
tphalp Oct 29, 2024
70a0dbf
Fix aggregators.test
tphalp Oct 29, 2024
c4413e5
Remove MX e2e tests, and remove playwright
tphalp Oct 29, 2024
d65bd13
WIP: Still working on fixing e2e for verification
tphalp Oct 29, 2024
fa89384
Put stubs back in....apparently some of them are necessary
tphalp Oct 29, 2024
461b3fc
Add ts-expect-error, and remove mx test creds
tphalp Oct 29, 2024
b9c1dc0
Remove ts-expect-error
tphalp Oct 29, 2024
90566eb
Test fix for redis false positive healthcheck
tphalp Oct 29, 2024
556d6a6
Extend redis healthcheck params
tphalp Oct 29, 2024
73c6980
Revert redis changes
tphalp Oct 29, 2024
c81540a
Redis healthcheck
tphalp Oct 29, 2024
c4dc101
Just go back to the original
tphalp Oct 29, 2024
6858b25
Remove debug tool for gh actions.
tphalp Oct 30, 2024
f7e0fc5
Remove explicit adapter initialization
tphalp Oct 30, 2024
bc5afbf
Change mock implementation
tphalp Oct 30, 2024
40d68cf
Add tests for User deletion back in, using test adapter
tphalp Oct 30, 2024
2eea684
Fix aggregators.test.ts
tphalp Oct 30, 2024
9445cc3
Clean up and unify constants files
tphalp Nov 1, 2024
a94ba37
Ooops
tphalp Nov 1, 2024
3994e26
Add RequestHandler code
tphalp Nov 1, 2024
fc1afb3
Add some checks
tphalp Nov 1, 2024
60356c5
Fix code scanning alert no. 28: Exception text reinterpreted as HTML
tphalp Nov 1, 2024
5b71203
New dep from codeql
tphalp Nov 1, 2024
ef148ec
Add 'he' types
tphalp Nov 1, 2024
02df77c
Fix tests that are affected by 'he.encode'
tphalp Nov 1, 2024
3cbb245
Debug docker
tphalp Nov 1, 2024
7f46b24
More he.encode issues
tphalp Nov 1, 2024
9ee15c8
One more CodeCL fix
tphalp Nov 1, 2024
18ddaed
Add mx-adapter until 1.0.0
tphalp Nov 4, 2024
eafa40a
Changes from mx-adapter repo
tphalp Nov 4, 2024
3f7b6ed
Merge branch 'main' into tysn/remove-mx-adapter-UCP-377
tphalp Nov 5, 2024
9219417
New RequestHandler code
tphalp Nov 5, 2024
e310a72
Remove commented code
tphalp Nov 5, 2024
98f394a
Remove comments
tphalp Nov 5, 2024
5fe4d4f
Put tests back in, and base them on the test adapter, instead of mx
tphalp Nov 6, 2024
a66afdd
Merge branch 'main' into tysn/remove-mx-adapter-UCP-377
tphalp Nov 6, 2024
fe0f774
Fix e2e tests for test example
tphalp Nov 6, 2024
e1e0c24
New jobEndpoint tests
tphalp Nov 7, 2024
dc19021
Merge branch 'main' into tysn/remove-mx-adapter-UCP-377
tphalp Nov 7, 2024
fca1c79
Better widget job types
tphalp Nov 7, 2024
40c1830
Switch to an enum
tphalp Nov 7, 2024
360724a
Update server and ui versions for docker
tphalp Nov 7, 2024
ee002a5
Revert and remove
tphalp Nov 7, 2024
9b839cb
Typo
tphalp Nov 7, 2024
59800e9
Fix unit tests
tphalp Nov 7, 2024
cb048df
Put new code back in, along side original code
tphalp Nov 7, 2024
bb24202
Merge pull request #128 from Universal-Connect-Project/tysn/remove-mx…
wesrisenmay-mx Nov 8, 2024
02520e8
Merge branch 'main' of https://github.com/Universal-Connect-Project/u…
wesrisenmay-mx Nov 8, 2024
1f09738
update version
wesrisenmay-mx Nov 8, 2024
834d71f
Merge pull request #5 from Universal-Connect-Project/wes/sync
wesrisenmay-mx Nov 8, 2024
d916cae
Merge branch 'main' of https://github.com/Universal-Connect-Project/u…
wesrisenmay-mx Nov 8, 2024
91aabf0
update version
wesrisenmay-mx Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/e2e-cypress-alt.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Tests Alternate Preferences
name: E2E Tests (Server) Alternate Preferences

on: pull_request

Expand All @@ -24,7 +24,7 @@ jobs:
xpack.security.enabled: false

redis:
image: redis
image: redis:7.2-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 20s
Expand Down Expand Up @@ -55,16 +55,15 @@ jobs:
run: |
ENV_FILE_PATH=./apps/server/.env
touch ${ENV_FILE_PATH}

# Vars
echo -e "${{ needs.setup-env.outputs.env_vars }}" >> ${ENV_FILE_PATH}
echo RESOURCEVERSION="" >> ${ENV_FILE_PATH}

# Secrets (can't load these from another job, due to GH security features)
echo SOPHTRONAPIUSERID=${{ secrets.SOPHTRON_API_USER_ID }} >> ${ENV_FILE_PATH}
echo SOPHTRONAPIUSERSECRET=${{ secrets.SOPHTRON_API_USER_SECRET }} >> ${ENV_FILE_PATH}
echo MXCLIENTID=${{ secrets.MX_CLIENT_ID }} >> ${ENV_FILE_PATH}
echo MXAPISECRET=${{ secrets.MX_API_SECRET }} >> ${ENV_FILE_PATH}

cat ${ENV_FILE_PATH}
- name: Cypress run
uses: cypress-io/github-action@v6
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-cypress-prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Tests Prod
name: E2E Tests (Server) Prod

on: pull_request

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-cypress.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E Tests
name: E2E Tests (Server) General

on: pull_request

Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/e2e-playwright.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ jobs:
echo SOPHTRONAPIUSERID=testUserId >> ${ENV_FILE_PATH}
echo SOPHTRONAPIUSERSECRET=testUserSecret >> ${ENV_FILE_PATH}

echo MXCLIENTID=testClientId >> ${ENV_FILE_PATH}
echo MXAPISECRET=testClientSecret >> ${ENV_FILE_PATH}

# Secrets (can't load these from another job, due to GH security features)
cat ${ENV_FILE_PATH}

- name: Run Jest Tests
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"defaultAggregator": "sophtron",

"supportedAggregators": ["mx", "sophtron"],
"supportedAggregators": ["sophtron"],

"defaultAggregatorVolume": {},

"institutionAggregatorVolumeMap": {},

"hiddenInstitutions": [],

"recommendedInstitutions": ["a76f5333-8493-42cf-bc86-dcc8a0f17d4c"]
"recommendedInstitutions": ["14627498-29cb-4296-a77f-910859eef104"]
}
2 changes: 1 addition & 1 deletion apps/server/cypress/e2e/suite1/queryParameters.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JobTypes } from "../../../src/shared/contract";
import { JobTypes } from "@repo/utils";
import {
clickContinue,
expectConnectionSuccess,
Expand Down
2 changes: 1 addition & 1 deletion apps/server/cypress/e2e/suite1/testExample.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JobTypes } from "../../../src/shared/contract";
import { JobTypes } from "@repo/utils";
import {
clickContinue,
expectConnectionSuccess,
Expand Down
31 changes: 0 additions & 31 deletions apps/server/cypress/e2e/suite2/mx.cy.ts
Original file line number Diff line number Diff line change
@@ -1,31 +0,0 @@
import { JobTypes } from "../../../src/shared/contract";
import { generateVcDataTests } from "@repo/utils-dev-dependency";
import { enterMxCredentials, searchAndSelectMx } from "../../shared/utils/mx";
import {
clickContinue,
expectConnectionSuccess,
refreshAConnection,
} from "@repo/utils-dev-dependency";

const makeAConnection = async (jobType) => {
searchAndSelectMx();
enterMxCredentials();
clickContinue();

if ([JobTypes.ALL, JobTypes.VERIFICATION].includes(jobType)) {
cy.findByText("Checking").click();
clickContinue();
}
expectConnectionSuccess();
};

describe("mx aggregator", () => {
generateVcDataTests({ makeAConnection });

it("refreshes an mx connection if given the correct parameters and hides the back button", () => {
refreshAConnection({
enterCredentials: enterMxCredentials,
selectInstitution: searchAndSelectMx,
});
});
});
2 changes: 1 addition & 1 deletion apps/server/cypress/e2e/suite2/sophtron.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JobTypes } from "../../../src/shared/contract";
import { JobTypes } from "@repo/utils";
import { generateVcDataTests, visitAgg } from "@repo/utils-dev-dependency";
import {
expectConnectionSuccess,
Expand Down
11 changes: 0 additions & 11 deletions apps/server/cypress/shared/utils/mx.ts

This file was deleted.

5 changes: 4 additions & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "0.0.13-beta",
"version": "0.0.14-beta",
"packageManager": "npm@10.8.2",
"scripts": {
"cypress:open": "cypress open --config-file cypress.config.ts",
Expand Down Expand Up @@ -32,7 +32,9 @@
"@repo/utils": "*",
"@types/crypto-js": "^4.2.2",
"@types/express": "^4.17.21",
"@types/he": "^1.2.3",
"@types/uuid": "^9.0.8",
"@ucp-npm/mx-adapter": "^0.0.16-alpha",
"@ucp-npm/template-adapter": "*",
"@ucp-npm/finicity-adapter": "*",
"assert-browserify": "^2.0.0",
Expand All @@ -44,6 +46,7 @@
"express": "^4.19.2",
"express-async-errors": "^3.1.1",
"express-rate-limit": "^7.0.2",
"he": "^1.2.0",
"joi": "^17.13.3",
"js-logger": "^1.6.1",
"mx-platform-node": "^0.42.0",
Expand Down
32 changes: 0 additions & 32 deletions apps/server/playwright/mx.playwright.ts

This file was deleted.

104 changes: 40 additions & 64 deletions apps/server/src/adapterIndex.test.ts
Original file line number Diff line number Diff line change
@@ -1,74 +1,50 @@
import { VCDataTypes } from '@repo/utils'
import { getAggregatorAdapter, getVC } from './adapterIndex'
import type { Aggregator } from './adapterSetup'
import {
mxVcAccountsData,
mxVcIntegrationAccountsData
} from './test/testData/mxVcData'
import { sophtronVcAccountsData } from './test/testData/sophtronVcData'
import { TEST_EXAMPLE_A_AGGREGATOR_STRING, TestAdapter } from './test-adapter'

const connectionId = 'testConectionId'
const type = VCDataTypes.ACCOUNTS
const userId = 'testUserId'

describe('adapterSetup', () => {
describe('getVC', () => {
it('uses mx integration if the aggregator is mx_int', async () => {
import { VCDataTypes } from "@repo/utils";
import { getAggregatorAdapter, getVC } from "./adapterIndex";
import type { Aggregator } from "./adapterSetup";
import { sophtronVcAccountsData } from "./test/testData/sophtronVcData";
import { TEST_EXAMPLE_A_AGGREGATOR_STRING, TestAdapter } from "./test-adapter";

const connectionId = "testConectionId";
const type = VCDataTypes.ACCOUNTS;
const userId = "testUserId";

describe("adapterSetup", () => {
describe("getVC", () => {
it("uses sophtron if the aggregator is sophtron", async () => {
const response = await getVC({
aggregator: 'mx_int',
aggregator: "sophtron",
connectionId,
type,
userId
})
userId,
});

expect(response).toEqual(mxVcIntegrationAccountsData)
})
it('uses mx prod if the aggregator is mx', async () => {
const response = await getVC({
aggregator: 'mx',
connectionId,
type,
userId
})
expect(response).toEqual(sophtronVcAccountsData);
});

expect(response).toEqual(mxVcAccountsData)
})
it('uses sophtron if the aggregator is sophtron', async () => {
const response = await getVC({
aggregator: 'sophtron',
connectionId,
type,
userId
})

expect(response).toEqual(sophtronVcAccountsData)
})

it('throws an error if the aggregator doesnt have a handler', async () => {
it("throws an error if the aggregator doesnt have a handler", async () => {
await expect(
async () =>
await getVC({
aggregator: 'junk' as Aggregator,
aggregator: "junk" as Aggregator,
connectionId,
type,
userId
})
).rejects.toThrow('Unsupported aggregator junk')
})
})

describe('getAggregatorAdapter', () => {
it('throws an error if its an unsupported aggregator', async () => {
expect(() => getAggregatorAdapter('junk' as Aggregator)).toThrow(
'Unsupported aggregator junk'
)
})

it('returns the testExample widget adapter', () => {
const adapter = getAggregatorAdapter(TEST_EXAMPLE_A_AGGREGATOR_STRING)

expect(adapter).toBeInstanceOf(TestAdapter)
})
})
})
userId,
}),
).rejects.toThrow("Unsupported aggregator junk");
});
});

describe("getAggregatorAdapter", () => {
it("throws an error if its an unsupported aggregator", async () => {
expect(() => getAggregatorAdapter("junk" as Aggregator)).toThrow(
"Unsupported aggregator junk",
);
});

it("returns the testExample widget adapter", () => {
const adapter = getAggregatorAdapter(TEST_EXAMPLE_A_AGGREGATOR_STRING);

expect(adapter).toBeInstanceOf(TestAdapter);
});
});
});
Loading