IT |
気になる、記になる… |
nanaco、iPhoneとApple Watchの「ウォレット」アプリで新規発行が可能に |
https://taisy0.com/2022/03/18/154865.html
|
決済サービス |
2022-03-18 03:44:18 |
IT |
気になる、記になる… |
「Apex Legends Mobile」の事前登録受付がスタート |
https://taisy0.com/2022/03/18/154863.html
|
apexlegends |
2022-03-18 03:34:59 |
IT |
気になる、記になる… |
Amazon、Kindleストアで「2022春のゲーム関連書籍フェア」のセールを開催中 − 約530冊が半額に |
https://taisy0.com/2022/03/18/154860.html
|
amazon |
2022-03-18 03:26:42 |
IT |
気になる、記になる… |
Satechi、「MacBook Pro/Air」向けの新型USB-Cハブ「Satechi Pro ハブ Max」を発売 |
https://taisy0.com/2022/03/18/154742.html
|
apple |
2022-03-18 03:08:30 |
IT |
気になる、記になる… |
Amazon、3月26日より「Amazon 新生活セール」を開催へ − 「Echo Buds」が3,000円オフに |
https://taisy0.com/2022/03/18/154855.html
|
amazon |
2022-03-18 03:02:01 |
TECH |
Engadget Japanese |
「iPhone 14」のCADレンダと称する画像が公開。13とほとんど変化なし? |
https://japanese.engadget.com/alleged-iphone-14-design-leak-no-change-13-034041895.html
|
iphone |
2022-03-18 03:40:41 |
TECH |
Engadget Japanese |
ストーカー防止に不審なTileがないかをチェックできる「スキャンと安全」機能リリース |
https://japanese.engadget.com/tile-scan-and-secure-032030979.html
|
scanandsecure |
2022-03-18 03:20:30 |
TECH |
Engadget Japanese |
macOS 12.3更新でロジックボード交換済みMacが文鎮化したとの複数報告 |
https://japanese.engadget.com/macos-monterey-123-update-bricking-mac-logic-board-replacements-030037690.html
|
macbookpro |
2022-03-18 03:00:37 |
ROBOT |
ロボスタ |
アシモはHondaウエルカムプラザ青山もまもなく卒業 ASIMO開発の歩み特別展示とステージショー特別版を開催中 3/31まで |
https://robotstart.info/2022/03/18/asimo-aoyama-graduation.html
|
|
2022-03-18 03:29:17 |
ROBOT |
ロボスタ |
ヤマダホールディング Roborockのロボット掃除機「S7 MaxV Plus」「S7 MaxV」を独占販売 先進センサーと2種類のカメラ搭載 |
https://robotstart.info/2022/03/18/yamadahd-roborock-s7-maxv-plus.html
|
|
2022-03-18 03:23:01 |
IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] 50代男性の約75%が「職場で人の役に立っていると感じられない」と回答 なぜ? |
https://www.itmedia.co.jp/business/articles/2203/18/news104.html
|
itmedia |
2022-03-18 12:43:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] スマホゲーム「ヘブンバーンズレッド」、ゲーム全編を配信可能に ガイドライン改定で配信禁止箇所を削除 |
https://www.itmedia.co.jp/news/articles/2203/18/news106.html
|
iosandroid |
2022-03-18 12:38:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] Mac Studioの知られざる細部をチェックしてみた SDカードの転送速度は? Mac miniとどこが違う? |
https://www.itmedia.co.jp/news/articles/2203/18/news102.html
|
itmedianewsmacstudio |
2022-03-18 12:36:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] コロナの中なぜホテル事業に進出? タカラレーベンの狙い |
https://www.itmedia.co.jp/business/articles/2203/18/news082.html
|
hotelthelebenosaka |
2022-03-18 12:15:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia PC USER] デル、中小企業向け14型ノート「Vostro 3420」 第11世代Core採用 |
https://www.itmedia.co.jp/pcuser/articles/2203/18/news097.html
|
itmediapcuser |
2022-03-18 12:14:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] ブリヂストンにランサムウェア攻撃 クルマ関連企業へのサイバー攻撃相次ぐ |
https://www.itmedia.co.jp/news/articles/2203/18/news095.html
|
itmedia |
2022-03-18 12:01:00 |
TECH |
Techable(テッカブル) |
誰でもすぐにVisaカードを発行できる「Kyash」事業拡大へ、 国内外から約49億円調達 |
https://techable.jp/archives/175451
|
kyash |
2022-03-18 03:00:53 |
IT |
情報システムリーダーのためのIT情報専門サイト IT Leaders |
NEC、「Windows パッチ運用代行サービス」を提供、パッチ適用をリモートから代行 | IT Leaders |
https://it.impress.co.jp/articles/-/22862
|
NEC、「Windowsパッチ運用代行サービス」を提供、パッチ適用をリモートから代行ITLeadersNECは年月日、「Windowsパッチ運用代行サービス」を販売開始した。 |
2022-03-18 12:46:00 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Google Cloud WorkflowsをPythonから引数指定で実行してみる |
https://qiita.com/yomon8/items/da5d06ac828ecc94f0e9
|
GoogleCloudWorkflowsをPythonから引数指定で実行してみるWorkflow登録引数を取って、秒スリープ後、結果出力という簡単なワークフローを登録します。 |
2022-03-18 12:51:07 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Djangoでアプリの作成 |
https://qiita.com/phiniki/items/afdc6e7d4098fcb38a7b
|
djangoadminstartprojectProjectName開発用サーバーの起動cdでプロジェクトディレクトリに移動するcdProjectName移動出来たら以下を実行する。 |
2022-03-18 12:46:45 |
GCP |
gcpタグが付けられた新着投稿 - Qiita |
Google Cloud WorkflowsをPythonから引数指定で実行してみる |
https://qiita.com/yomon8/items/da5d06ac828ecc94f0e9
|
GoogleCloudWorkflowsをPythonから引数指定で実行してみるWorkflow登録引数を取って、秒スリープ後、結果出力という簡単なワークフローを登録します。 |
2022-03-18 12:51:07 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
私のためのGitコマンド |
https://qiita.com/turituri08/items/71db4350f8ca6424ac98
|
とあるリポジトリをForkし、cloneしてローカル環境にリポジトリを持ってくるそこでブランチを切り、機能の追加や問題点を修正し、PullRequestを送るといった流れで、他のソフトウェア開発に参戦することができる。 |
2022-03-18 12:43:46 |
技術ブログ |
Developers.IO |
[小ネタ]Elastic Beanstalkで作成した環境に紐付いているAuto Scallingグループをコマンド一発で確認する |
https://dev.classmethod.jp/articles/aws-eb-found-as-name/
|
amazonelasticbeanstalk |
2022-03-18 03:24:18 |
海外TECH |
DEV Community |
🏂 AWS CDK 101 🌺 - Jest testing with a TDD approach for our construct |
https://dev.to/aravindvcyber/aws-cdk-101-jest-testing-with-a-tdd-approach-for-our-construct-2aeh
|
AWS CDK Jest testing with a TDD approach for our constructBeginners new to AWS CDK please do look at my previous articles one by one in this series If in case missed the previous article do find it with the below links Original previous post at Dev PostReposted previous post at dev to aravindvcyberIn this article let us introduce writing jest test cases that would help us in testing our construct which we have created in our previous CDK articleFor simplicity we will be only creating test cases for the construct which we have introduced And so this does not limit you hence you are free to extend this throughout your project Jest setup We start by creating a new folder called test at the root of our current project Add a new file like event counter test tsMake sure you also have to create a jest config file as shown below jest config js in the root of your project module exports testEnvironment node roots lt rootDir gt test testMatch test ts transform tsx ts jest Also I use the below script in package JSON so that I could build and run the test case using npm run test test npm run build amp amp jest coverage Testing advantages in CDK project The one advantage of testing is that we could develop our stack and make use of test suites to validate our stack even before deploying to dev environments Also certain trivial things which we are very sure could be overridden and so always writing the test cases ahead of time make sure that the simplest of things are always validated before deployment We could cover most of the feature testing in the test cases themselves and we will be able to make sure it is very close to our expectations before we deploy Since I have already composed my test cases I will be using jest only to make sure we try one at a time Some helper functions to remove code duplication Also I have defined some reusable helper functions to create the handler function and initialize the construct we have created as follows To initialize the event counter lambda function ️const initHandler stack cdk Stack lambda Function gt return new lambda Function stack TestFunction runtime lambda Runtime NODEJS X handler event counter counter code lambda Code fromAsset lambda To initialize our construct for testing const initEventCounter stack cdk Stack handler lambda Function EventCounter gt return new EventCounter stack MyTestConstruct backend handler tableName Event Counters partitionKeyName Counter Name Also find the imported modules which include our construct to test an assertions library and the standard CDK libraries as required import Template Capture from aws cdk lib assertions import as cdk from aws cdk lib import as lambda from aws cdk lib aws lambda import EventCounter from constructs event counter Lambda has Environment variables Let us start with the first test case as shown below a simple way to check whether the resources will be provisioned are not test only Lambda Has Environment Variables gt const stack new cdk Stack WHEN let handler initHandler stack let eventCounter initEventCounter stack handler THEN const template Template fromStack stack console log template console log JSON stringify template In this test case we have initialized a stack and initialized the event counter with a new handler function Testing strategy for CDK Before discussing the assertions I have logged the console output to show you what will be our testing strategy here console log Template template Resources TestFunctionServiceRoleABDC Object TestFunctionADFC Object MyTestConstructEventCountersFDBB Object MyTestConstructEventCounterHandlerServiceRoleABC Object MyTestConstructEventCounterHandlerServiceRoleDefaultPolicyC Object MyTestConstructEventCounterHandlerCF Object MyTestConstructEventCounterHandlerLogRetentionDF Object LogRetentionaaeaacbdfbdbefddaServiceRoleECFB Object LogRetentionaaeaacbdfbdbefddaServiceRoleDefaultPolicyADDADEB Object LogRetentionaaeaacbdfbdbefddaFDBFCA Object Parameters BootstrapVersion Object Rules CheckBootstrapVersion Object at Object lt anonymous gt test event counter test ts You can see that this is the actual CDK synthesized template and we could make our test cases targeting this output referenced objects Those of you who didn t understand what I mean here can see the details template log by doing a console log JSON stringify template This has the snapshot of the resources that we are about to create we could now capture parts of this and perform our assertions to resolve the test cases template hasResourceProperties AWS Lambda Function Environment envCapture expect envCapture asObject toEqual Variables BACKEND FUNCTION NAME Ref TestFunctionADFC EVENT COUNTER TABLE NAME Ref MyTestConstructEventCountersFDBB In the above block of close we are finding a property of type AWS Lambda Function and capturing the value of the object Environment Then we subject this to our asserts here the first time we validate we expect it to fail and once we are sure of the resources provisioned we can update the toEqual to the right value for the Ref which is generated based on your test case and the current environment bootstrap template DynamoDB table created Let us write another test case where we would verify that only one dynamodb table has is present as follows resourceCountIs method is used to get the count of similar resources provisioned test only DynamoDB Table Created gt const stack new cdk Stack WHEN let handler initHandler stack let eventCounter initEventCounter stack handler THEN const template Template fromStack stack template resourceCountIs AWS DynamoDB Table PASS test event counter test ts s ✓ Lambda Has Environment Variables ms ✓ DynamoDB Table Created ms DynamoDB table created with Encryption Now let us do some TDD based development by creating our test case first and fixing it test DynamoDB Table Created With Encryption gt const stack new cdk Stack WHEN let handler initHandler stack let eventCounter initEventCounter stack handler THEN const template Template fromStack stack template hasResourceProperties AWS DynamoDB Table SSESpecification SSEEnabled true Here we were expecting a Dynamodb table to be provisioned with some specifications mentioned in the assertion It is nothing but we are expecting the encryption feature to be turned on for the table FAIL test event counter test ts s ✓ Lambda Has Environment Variables ms ✓ DynamoDB Table Created ms ✕ DynamoDB Table Created With Encryption ms DynamoDB Table Created With Encryption The template has resource with the type AWS DynamoDB Table but none match as expected The closest result is Type AWS DynamoDB Table Properties KeySchema AttributeName Counter Name KeyType HASH AttributeDefinitions AttributeName Counter Name AttributeType S ProvisionedThroughput ReadCapacityUnits WriteCapacityUnits UpdateReplacePolicy Delete DeletionPolicy Delete with the following mismatches Missing key at Properties SSESpecification using objectLike matcher THEN const template Template fromStack stack gt template hasResourceProperties AWS DynamoDB Table SSESpecification SSEEnabled true at Template hasResourceProperties node modules aws cdk lib assertions lib template ts at Object lt anonymous gt test event counter test ts As expected the test case failed we could add the necessary feature right away by updating our construct event counter ts as follows while we are defining the dynamodb const Counters new dynamodb Table this tableName partitionKey name partitionKeyName type dynamodb AttributeType STRING encryption dynamodb TableEncryption AWS MANAGED added for TDD Yes we have got that right now PASS test event counter test ts s ✓ Lambda Has Environment Variables ms ✓ DynamoDB Table Created ms ✓ DynamoDB Table Created With Encryption ms By default the Dynamodb constructor will provision resources with default specifications like read units and write units But we may need to have it tweak a bit based on environments and specific peak load expectations of the read and write patterns we expect Let us add one more test case as follows read capacity can be configured The first couple of failure causes where we want the capacity to be restricted are as follows test read capacity can be configured gt const stack new cdk Stack expect gt let handler new EventCounter stack MyTestConstruct backend handler tableName Event Counters partitionKeyName Counter Name readCapacity writeCapacity toThrowError readCapacity must be greater than and less than write capacity should be in the range of to test write capacity should be in the range of to gt const stack new cdk Stack expect gt let handler initHandler stack new EventCounter stack MyTestConstruct backend handler tableName Event Counters partitionKeyName Counter Name readCapacity writeCapacity toThrowError writeCapacity must be greater than and less than To enable this we have to add some code to the constructs event counter ts to throw necessary exceptions export interface EventCounterProps the function for which we want to count Event messages backend lambda IFunction tableName string partitionKeyName string readCapacity number writeCapacity number constructor scope Construct id string props EventCounterProps if props readCapacity undefined amp amp props readCapacity lt props readCapacity gt throw new Error readCapacity must be greater than and less than if props writeCapacity undefined amp amp props writeCapacity lt props writeCapacity gt throw new Error writeCapacity must be greater than and less than super scope id const Counters new dynamodb Table this tableName partitionKey name partitionKeyName type dynamodb AttributeType STRING encryption dynamodb TableEncryption AWS MANAGED readCapacity props readCapacity writeCapacity props writeCapacity You could identify now that we have added logic to throw an exception when our expected range is not met for the read and right capacity in the assertions statements with toThrowError PASS test event counter test ts s ✓ Lambda Has Environment Variables ms ✓ DynamoDB Table Created ms ✓ DynamoDB Table Created With Encryption ms ✓ read capacity can be configured ms ✓ write capacity should be in the range of to ms DynamoDB Table Created With sample read and write units as well Similarly we can add a test case without exception to simulate the positive test case as well for read and write capacity units test only DynamoDB Table Created With sample read and write units as well gt const stack new cdk Stack WHEN let handler initHandler stack new EventCounter stack MyTestConstruct backend handler tableName Event Counters partitionKeyName Counter Name readCapacity writeCapacity THEN const template Template fromStack stack template hasResourceProperties AWS DynamoDB Table KeySchema AttributeName Counter Name KeyType HASH AttributeDefinitions AttributeName Counter Name AttributeType S ProvisionedThroughput ReadCapacityUnits WriteCapacityUnits SSESpecification SSEEnabled true PASS test event counter test ts s ✓ Lambda Has Environment Variables ms ✓ DynamoDB Table Created ms ✓ DynamoDB Table Created With Encryption ms ✓ read capacity can be configured ms ✓ write capacity should be in the range of to ms ✓ DynamoDB Table Created With sample read and write units as well ms The th test case also helped our test case to reach percent test coverage as follows File Stmts Branch Funcs Lines Uncovered Line s All files event counter ts File Stmts Branch Funcs Lines Uncovered Line s All files event counter ts Still we have right more test cases based on the functional expectations on the important aspects of the constructs Lambda has log retention specified with days test only Lambda Has logRetention specified with days gt const stack new cdk Stack WHEN let handler initHandler stack new EventCounter stack MyTestConstruct backend handler tableName Event Counters partitionKeyName Counter Name readCapacity writeCapacity THEN const template Template fromStack stack const cp new Capture const cp new Capture template hasResourceProperties Custom LogRetention LogGroupName cp RetentionInDays cp expect cp asObject toEqual Fn Join aws lambda Ref MyTestConstructEventCounterHandlerCF expect cp asNumber toEqual The above test case shows how we can do numerical and object level assertions and also let us know how to capture a segment of the code into variables to perform assertions Lambda Has read write access on dynamodb and can invoke backend function The below test case is used to validate the IAM policy making sure the lambda function can perform write operations on dynamodb created and can also invoke the backend handler function Here an assertion is performed with a captured variable as asArraytest only Lambda Has read write access on dynamodb and can invoke backend function gt const stack new cdk Stack WHEN let handler new lambda Function stack TestFunction runtime lambda Runtime NODEJS X handler event counter counter code lambda Code fromAsset lambda let counter new EventCounter stack MyTestConstruct backend handler tableName Event Counters partitionKeyName Counter Name readCapacity writeCapacity THEN const template Template fromStack stack const cp new Capture template hasResourceProperties AWS IAM Policy PolicyDocument Statement cp expect cp asArray toEqual Action dynamodb BatchGetItem dynamodb GetRecords dynamodb GetShardIterator dynamodb Query dynamodb GetItem dynamodb Scan dynamodb ConditionCheckItem dynamodb BatchWriteItem dynamodb PutItem dynamodb UpdateItem dynamodb DeleteItem Effect Allow Resource Fn GetAtt MyTestConstructEventCountersFDBB Arn Ref AWS NoValue Action lambda InvokeFunction Effect Allow Resource Fn GetAtt TestFunctionADFC Arn PASS test event counter test ts s ✓ Lambda Has Environment Variables ms ✓ DynamoDB Table Created ms ✓ DynamoDB Table Created With Encryption ms ✓ read capacity can be configured ms ✓ write capacity should be in the range of to ms ✓ DynamoDB Table Created With sample read and write units as well ms ✓ Lambda Has logRetention specified with days ms ✓ Lambda Has read write access on dynamodb and can invoke backend function ms File Stmts Branch Funcs Lines Uncovered Line s All files event counter ts Test Suites passed totalTests passed totalSnapshots totalTime sRan all test suites Conclusion for testing in CDK Thus we have demonstrated how we can write extensive test cases for our construct and project modules using jest You can also make use of the file cdk out CommonEventStack template json as a reference which will have the full template for the stack to be provisioned to write more similar integrated test cases at the project level without deploying to the actual environment We will add more connections to this API gateway and lambda stack and make it more usable in the upcoming articles so do consider following and subscribing to my newsletter Thanks for supporting Would be great if you like to Buy Me a Coffee to help boost my efforts Original post at Dev PostReposted at dev to aravindvcyber |
2022-03-18 03:40:14 |
金融 |
日本銀行:RSS |
当面の金融政策運営について |
http://www.boj.or.jp/announcements/release_2022/k220318a.pdf
|
金融政策 |
2022-03-18 12:30:00 |
ニュース |
BBC News - Home |
Burger King Russia partner 'refused' to shut shops |
https://www.bbc.co.uk/news/business-60789772?at_medium=RSS&at_campaign=KARANGA
|
restaurants |
2022-03-18 03:23:59 |
ニュース |
BBC News - Home |
China lockdowns: The economic cost of a zero-Covid policy |
https://www.bbc.co.uk/news/business-60761107?at_medium=RSS&at_campaign=KARANGA
|
analysts |
2022-03-18 03:16:07 |
北海道 |
北海道新聞 |
立民、1人区の候補者調整へ 参院選、野党3党申し入れ |
https://www.hokkaido-np.co.jp/article/658433/
|
申し入れ |
2022-03-18 12:33:00 |
北海道 |
北海道新聞 |
低気圧でフェリー3便欠航 19、20日 |
https://www.hokkaido-np.co.jp/article/658428/
|
商船三井フェリー |
2022-03-18 12:29:00 |
北海道 |
北海道新聞 |
悠仁さま、両陛下と面会 中学卒業であいさつ |
https://www.hokkaido-np.co.jp/article/658427/
|
面会 |
2022-03-18 12:23:00 |
北海道 |
北海道新聞 |
多額寄付理由に交付税減額 ふるさと納税で2市町に |
https://www.hokkaido-np.co.jp/article/658426/
|
総務省 |
2022-03-18 12:19:00 |
北海道 |
北海道新聞 |
ロシア産供給不安で対策本部 経産省、天然ガス・原油や鉱物 |
https://www.hokkaido-np.co.jp/article/658405/
|
経済活動 |
2022-03-18 12:04:11 |
北海道 |
北海道新聞 |
巡査長、聴取の高齢者から詐取か 神奈川県警、書類送検へ |
https://www.hokkaido-np.co.jp/article/658398/
|
書類送検 |
2022-03-18 12:20:06 |
北海道 |
北海道新聞 |
東証、午前終値は2万6724円 米株高を好感、一進一退の展開 |
https://www.hokkaido-np.co.jp/article/658409/
|
前日終値 |
2022-03-18 12:08:00 |
北海道 |
北海道新聞 |
モデルナも4回目接種を申請 米、18歳以上対象 |
https://www.hokkaido-np.co.jp/article/658408/
|
申請 |
2022-03-18 12:08:00 |
北海道 |
北海道新聞 |
米で13歳運転の車衝突9人死亡 テキサス州、大学生乗る車両と |
https://www.hokkaido-np.co.jp/article/658407/
|
幹線道路 |
2022-03-18 12:08:00 |
ビジネス |
東洋経済オンライン |
体内の余剰エネルギー燃やす「チリツモ」の超工夫 身体活動時代謝「ニート(NEAT)」を増やそう | 自分史上最高のカラダに!本気の肉体改造メソッド | 東洋経済オンライン |
https://toyokeizai.net/articles/-/538774?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
史上最高 |
2022-03-18 13:00:00 |
ビジネス |
東洋経済オンライン |
4月から「18歳成人」で変わるもの・変わらないもの 18歳、19歳は喪失する「未成年者取消権」の中身 | 学校・受験 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/538881?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
成人年齢 |
2022-03-18 12:30:00 |
IT |
週刊アスキー |
発売日がついにわかる!「アストロシティミニ V」×「ゲーセンミカド」“第3弾”応援動画が本日21時に配信 |
https://weekly.ascii.jp/elem/000/004/086/4086624/
|
youtube |
2022-03-18 12:50:00 |
IT |
週刊アスキー |
Beijing Roborock Technology、2種類のカメラを搭載したロボット掃除機「Roborock S7 MaxV Plus」と「Roborock S7 MaxV」を発売 |
https://weekly.ascii.jp/elem/000/004/086/4086610/
|
beijingroborocktechnology |
2022-03-18 12:40:00 |
IT |
週刊アスキー |
デジタルレシピ、パワーポイントのデータをノーコードでウェブサイトに変換できる「Slideflow」提供開始 |
https://weekly.ascii.jp/elem/000/004/086/4086590/
|
slide |
2022-03-18 12:10:00 |
マーケティング |
AdverTimes |
日清製粉ウェルナ60周年を機に初のコーポレートソング制作 多部未華子の優しい歌声がCMに |
https://www.advertimes.com/20220318/article379488/
|
会社設立 |
2022-03-18 03:54:55 |
コメント
コメントを投稿