Skip to content

Add integration test workflow #107

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

Merged
merged 3 commits into from
Aug 3, 2020
Merged

Conversation

anonymous-akorn
Copy link
Contributor

Most of this workflow is copied verbatim from the workflow to build the SDK. The duplication means that most changes to the SDK build workflow will need to be mirrored into this one.

There are two new parts for the integration tests:

  • Manual dispatch with input parameters that can be specified when triggering.
  • Two new steps ('Prepare for integration tests' and 'Build and run integration tests').

This PR is dependent on two other PRs:
#106
#103

This workflow is not set to run automatically. For now, it will only run on manual trigger. Which APIs to build/test, which platforms to build for, and which operating systems to run on can be specified when triggering.

Parameterizing the operating systems required a bit of hackery, as that requires modifying the job matrix. The input is supplied as a JSON list, and then fromJson converts it into valid YML. If and when Github implements a first party solution for this kind of thing, this should be easiest to migrate to that solution. Two alternatives were considered:

  1. Supply normal CSV input, then run a job to convert CSV to a JSON list. Has the benefit of a cleaner triggering interface, at the expense of more boilerplate, integration complexity, and an extra job in the workflow.
  2. Hard-code the three operating systems in the job matrix, then use a job-level "if" condition to see if the matrix.os value is contained in the input (which can be a normal CSV). This does not work as the context available when the condition is evaluated does not appear to include the values in the matrix.

Once the two dependent PRs are in, Desktop (build + test) should work. Android (build) might work. iOS definitely won't work for the foreseeable future.

Most of this workflow is copied verbatim from the workflow to build the SDK. There are two new parts for the integration tests:

- Manual dispatch with input parameters that can be specified when triggering.
- Two new steps ('Prepare for integration tests' and 'Build and run integration tests').
Instead of specifying the operating system input as a JSON, this will take a normal CSV string. A separate job, prepare_matrix, will run before the tests to convert the CSV to a JSON list.

The conversion is done by using sed to replace a comma with a quoted comma, and then inserting that value into ["$(new_value)"] using command substitution.
Copy link
Contributor

@vimanyu vimanyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DellaBitta DellaBitta merged commit 1ac576b into dev Aug 3, 2020
@anonymous-akorn anonymous-akorn deleted the feature/ak-integration-test-workflow branch August 3, 2020 20:51
@firebase firebase locked and limited conversation to collaborators Sep 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants