Skip to content

amp-bind: Speed up integration tests #8197

@dreamofabear

Description

@dreamofabear

First Timers Only

We know figuring out the process for contributing to an open source project can be intimidating, so we created this issue as a way for you to learn the ropes. (If you feel comfortable contributing to open source projects, please leave this issue for someone else.)

What you will need to know

AMP's test suite includes both unit tests and integration tests. Integration tests are particularly valuable because they allow us to test end-to-end functionality on compiled, production code.

Background

Our integration tests work by loading a local AMP HTML file (a "fixture") into an iframe and verifying behaviors on the fixture. Each test function (a Mocha it(...) function) in an integration test file loads the fixture before execution and unloads it afterwards.

Motivation

amp-bind currently has an integration test suite in test-bind-integration.js that mostly uses a single fixture in bind-integrations.html.

The current implementation has a major drawback: even though each test only depends on a small portion of the fixture, the entire fixture is always loaded. Further, the code being tested runs a moderately expensive scan on the entire fixture every time it's loaded, when only a small subset of the fixture is important to any one test.

Fixing this issue will speed up execution of our integration tests, which improves the productivity of all developers on AMP!

This is also a good way to get familiar with one of our most exciting new extensions, amp-bind.

Step by step

Once approved, your changes will be merged. ⚡⚡⚡Congrats on making your first contribution to the AMP Project!⚡⚡⚡ You'll be able to see it live across the web soon!

Thanks, and we hope to see more contributions from you soon.

Questions?

If you have questions ask in this issue or on your Pull Request (mentioning @choumx and @kmh287) or see the How to get help section of the Getting Started guide.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions