#Testing Backstage Plugins

1 messages · Page 1 of 1 (latest)

open sky
#

Hey everyone, I have a question regarding testing in Backstage.

Our repository standard requires a test folder that includes three types of tests:
1. Unit tests – to verify logic and behavior within a component.
2. Integration tests – to test interactions between two or more components with virtualized dependencies.
3. Intervention tests – to test the entire system at the plugin level.

Plugin A
|— src
|— test
|— unit
|— integration
|— intervention

I assume we’d follow a similar approach for the Backstage UI, especially to verify whether plugins are visible and working as expected.

The main concern we’re facing is related to build performance. As more plugins are added, the test suite will grow significantly, and we want to avoid slow build times. Since we’re working in a monorepo, we’re exploring strategies to manage this effectively.

We’ve come across the idea of selective testing, where only tests in plugin folders that have changed are executed. Is this something Spotify is using internally, or do you have other recommendations on how to handle test scaling in a monorepo?

Also, we’d love to hear if there’s a way to customize the plugin scaffolding structure when onboarding new ideas into Backstage, particularly to ensure test structure consistency.

open sky
#

@fiery helm you’ve helped in the past😄, thoughts?

fiery helm
#

in general our workflow files can be used as inspiration for some good practices

candid wagon
fiery helm
#

Of what though? 🤔

candid wagon
fiery helm
#

Right - so it's the --since parameter

#

That makes sure to make a diff against what was in master before, and only test things that are affected directly or indirectly by that diff

#

internally there's a PackageGraph thingy that deduces things based on the since argument

candid wagon
# fiery helm Right - so it's the --since parameter

Okay that's cool. I'm still going through the repo, but from what I can see -

The workflow is triggered when a pull request is created, and it only tests the code that was changed. It seems like you are running unit and integration tests here? Or do these tests include the UI (Playwright) tests?

I was also wondering, when is the full test suite executed incl. the end-to-end tests?

At the moment our project is set up to run the full suite at the build stage, so I'm trying to see which tests are run at which point in time to make sure we optimize the process as much possible.

fiery helm
#

Feel free to dig through those files, it's a bit much to explain

#

The full test suite including everything only runs on master builds (after merge) only because they turned out to be too slow to wait for for every pr

#
GitHub

Backstage is an open framework for building developer portals - backstage/backstage

GitHub

Backstage is an open framework for building developer portals - backstage/backstage

#

the former run most of the time, the latter only in special cases because windows is horribly slow and we got tired of waiting for it

#

better to just get notified about windows problems asynchronously when they rarely do happen (we have discord notifications) and fix as needed, instead of unconditionally waiting always