superfaceai / station

Comlink metadata for self-integrating applications.
https://superface.ai/catalog
MIT License
22 stars 5 forks source link

feat(migration to testing library v2.0.0): Update tests and recordings #173

Closed martinalbert closed 2 years ago

martinalbert commented 2 years ago

Description

This PR migrates station tests and recordings to testing library v2.0.0. (To be released)

Migration was done in three steps:

  1. changing format of placeholders - commit f78b5234c6ec6f45616532888926d64584dee22b
  2. renaming recording files with old hash to files with new hash - commits 1c1c25cd030995625c7f76c99ef1fd178e60fab1 & 9f638da5bcfcbc510369c39dfdea75cdda88d4e2
  3. removing unnecessary hooks or other hacks in tests - commit 5863d497c66f9ebd5106d0125c7d4d823d081fbc

This was done with locally yalced testing library, containing merged all currently open PRs in testing library, you can find migration code on branch migration/1.0.1-to-2.0.0 - https://github.com/superfaceai/testing/commit/d7e98a31e2cbf2be84da58ac53c57f78ae5fdf42

I don’t have keys for rerunning tests in record mode, which could possibly change recordings as 2.0.0 also contains functionality to hide credentials/parameters/input values in rawHeaders or in response. Please let me know if you know about such sensitive information and I’ll modify recordings or tests.

Motivation and Context

2.0.0 release of testing library (CHANGELOG)

Types of changes

Checklist:

janhalama commented 2 years ago

I tried to run tests locally with yalced @superface/testing migration/1.0.1-to-2.0.0 branch and 65 tests failed with

[SdkExecutionError: Request ended with network error: reject·
    At 2021-12-17T09:15:14.348Z
    No backup provider available
    ]

🤷

I suggest to release rc version of @superface/testing and use it this PR.

martinalbert commented 2 years ago

@janhalama Last commit in migration/1.0.1-to-2.0.0 implements migration, so that's probably why they're failing. Please try undoing last commit from that branch.

freaz commented 2 years ago

@jnv we now allow to create hashes based on test names or passed name or as it was till now based on inputs. You can pass different instances to testInstance and it should get correct hash generator. More here.