Azure / Azure/data-api-builder

Improve readability and extensibility in the test suite

オープン
#2,143 コメント 1 件 リアクション 0 件 担当者 1 名 @aaronburtle が担当を希望しています GitHub で見る
cleanup test
主要言語
C#
スター
1.5k
フォーク
370
平均マージ
3日 22時間
マージ済み PR(30日)
9

説明

Across our test suite, we have a number of tests that have correct functionality but can be difficult to modify and have some readability issues. Things like code duplication, and hard coded values can make updates to the test time consuming.

As an example, take this test from `GraphQLPaginationTests.RequestAfterTokenOnly`

![image](https://github.com/Azure/data-api-builder/assets/93220300/1829fe7d-14b9-46a4-94cc-5d9f282ad99d)

Because of how the expected values are coded, if for example we want to update this test because we have a case where the after token is not of this form, it requires us to add another conditional that matches the new case and then has the expected value setup their. This is difficult to read, and slow to update.

As we expand our functionality we will require updates to our test suite, and improving readability and extensibility will be useful.

One candidate for code duplication is the test class used in this PR

https://github.com/Azure/data-api-builder/pull/2139

which has many spots where code is duplicated across many tests.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。