-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from consensusnetworks/feature/iotex-actions
Feature/iotex actions
- Loading branch information
Showing
11 changed files
with
1,591 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as cdk from 'aws-cdk-lib' | ||
import { Template } from 'aws-cdk-lib/assertions' | ||
import { EtlStack } from '../lib/etl/etl-stack' | ||
import { eventSchema, aggSchema } from '@casimir/data' | ||
|
||
test('ETL stack created', () => { | ||
|
||
const defaultEnv = { account: '257202027633', region: 'us-east-2' } | ||
const project = 'Casimir' | ||
const stage = 'Test' | ||
|
||
const app = new cdk.App() | ||
const etlStack = new EtlStack(app, `${project}EtlStack${stage}`, { env: defaultEnv, project, stage }) | ||
|
||
const etlTemplate = Template.fromStack(etlStack) | ||
|
||
const resource = etlTemplate.findResources('AWS::Glue::Table') | ||
|
||
const eventTable = Object.keys(resource).filter(key => key.includes('EventTable')) | ||
const eventColumns = resource[eventTable[0]].Properties.TableInput.StorageDescriptor.Columns | ||
|
||
for (const column of eventColumns) { | ||
const { Name: name } = column | ||
const columnName = Object.keys(eventSchema.properties).filter(key => key === name)[0] | ||
expect(columnName).toEqual(name) | ||
} | ||
|
||
const aggTable = Object.keys(resource).filter(key => key.includes('AggTable'))[0] | ||
const aggColumns = resource[aggTable].Properties.TableInput.StorageDescriptor.Columns | ||
|
||
for (const column of aggColumns) { | ||
const { Name: name } = column | ||
const columnName = Object.keys(aggSchema.properties).filter(key => key === name)[0] | ||
expect(columnName).toEqual(name) | ||
} | ||
|
||
Object.keys(etlTemplate.findOutputs('*')).forEach(output => { | ||
expect(output).toBeDefined() | ||
}) | ||
}) |
Oops, something went wrong.