Announcements

Dummy premium accounts for library developers

Reply
Highlighted

Dummy premium accounts for library developers

Casual Listener

Hello!

 

I'm a developer from the rspotify library, a Rust wrapper for the Spotify Web API. I also worked on tekore a bit, which is another wrapper but written in Python.

 

The issue I'm facing at rspotify is that to run tests that require OAuth automatically (with GitHub Continuous Integration for instance), I need a refresh token for an account with Spotify Premium to access the different endpoints the Spotify Web API exposes. The refresh token doesn't expire as often as an access token, so it's good enough for the tests.

 

The main tekore developer, Felix Hildén, currently uses his own personal account for this, which does work, but is far from ideal because the tests have to be written so that they don't modify his profile, and has to be secret so that noone else has access to it.

 

But for rspotify none of the devs (including myself) want to share their refresh token to run these tests for different reasons, specially because it gives access to the full account and we consider that too risky as open source collaborators.

 

We were wondering if it'd be possible to have Spotify offer "development accounts" for such testing purposes. The accounts themselves wouldn't even need to work to listen to music, only for the Spotify Web API endpoints, so the cost for this proposal would be none.

 

This is beneficial for Spotify because this way the Web API libraries could write considerably improved tests, and with it, Spotify would have a more stable and robust ecosystem. Not only would that increase the quality of the apps, but also Spotify's usage to some extent.

2 Replies
Highlighted

Re: Dummy premium accounts for library developers

Music Fan
Does that not make your tests really slow? We've always mocked out anything outside of our code which includes all requests to Spotify's servers.
Highlighted

Re: Dummy premium accounts for library developers

Spotify
Spotify

Hi @marioom! Sorry, we don't currently have test premium accounts for developers. As @kingosticks4 points out, there are some benefits to writing tests that do not make live calls to the API. This allows you to run your tests while offline for example.

SUGGESTED POSTS