Skip to content

End-to-end testing #223

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

Closed
echeran opened this issue Sep 3, 2020 · 3 comments
Closed

End-to-end testing #223

echeran opened this issue Sep 3, 2020 · 3 comments
Assignees
Labels
C-test-infra Component: Integration test infrastructure duplicate This issue or pull request already exists T-core Type: Required functionality
Milestone

Comments

@echeran
Copy link
Contributor

echeran commented Sep 3, 2020

PR #86 has started thinking of designing end-to-end testing for components. Although it uses component structs to do comparisons on component API output, it specifies the data for test inputs and outputs using a custom set of structs (serializable to JSON).

This comment in the PR starts the discussion of how we can instead go through the data provider interface to fetch test data (inputs / outputs).

@echeran echeran self-assigned this Sep 3, 2020
@echeran echeran added the discuss Discuss at a future ICU4X-SC meeting label Sep 3, 2020
@echeran echeran linked a pull request Sep 3, 2020 that will close this issue
@sffc
Copy link
Member

sffc commented Sep 3, 2020

We could have an IterableDataProvider that gives hunks such as the following:

{
  input: "Zh-HANT",
  output: "zh-Hant"
}

This would be associated with a specific data key such as "testing/locale-canonic", or perhaps "locale/test-canonic".

We would dump this to a golden data file, and be able to re-generate the golden data file from actual behavior. Then for testing, we test that the raw golden data is equal to the re-generated golden data.

The golden data could have the following structure, e.g., with the FsDataProvider:

  • testing
    • locale-canonic
      • test001.json
      • test002.json
    • locale-test2
      • test001.json
      • test002.json

But then you would also have GoldenDataGenerationProvider, which would re-generate the above structure from the actual icu::Locale class. GoldenDataGenerationProvider may depend on FsDataProvider to read the inputs, but instead of forwarding the same outputs, it would re-generate the outputs from ICU4X library code. Then, for testing, you would compare the output of GoldenDataGenerationProvider to FsDataProvider.

@sffc sffc added C-test-infra Component: Integration test infrastructure T-core Type: Required functionality labels Sep 3, 2020
@sffc sffc added this to the 2020 Q3 milestone Sep 3, 2020
@echeran
Copy link
Contributor Author

echeran commented Sep 11, 2020

One thought that I had about the idea of using the data provider to provide test data, in a way that might be extensible to users, is that it seems related to #150 on "how do we hook a data provider to an API?". I think end-to-end testing could be another specific example for that question. And it seems to add evidence to our current working decision of having the data provider be an argument to low level APIs.

I'm still fuzzy on how that would look to make the data provider itself able to be swapped out by the user. It would need to be configured in some type of data somehow (ex: string identifier) within the test data so that the user can configure to use their own personal data provider. But there also has to be a mechanism (another interface / trait?) within the testing code that describes how to turn the data representing a data provider (ex: string identifier) and return the corresponding instance.

@echeran echeran removed the discuss Discuss at a future ICU4X-SC meeting label Sep 11, 2020
@sffc sffc modified the milestones: 2020 Q3, 2020 Q4 Oct 22, 2020
@sffc sffc modified the milestones: 2020 Q4, 2021-Q1-m1 Jan 7, 2021
@sffc sffc assigned sffc and unassigned echeran Feb 4, 2021
@sffc sffc modified the milestones: 2021-Q1-m1, ICU4X 0.2 Feb 4, 2021
@sffc sffc modified the milestones: ICU4X 0.2, 2021-Q2-m1 Mar 25, 2021
@sffc
Copy link
Member

sffc commented Apr 3, 2021

Merging this into #51 as a duplicate.

@sffc sffc closed this as completed Apr 3, 2021
@sffc sffc added the duplicate This issue or pull request already exists label Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-test-infra Component: Integration test infrastructure duplicate This issue or pull request already exists T-core Type: Required functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants