Should I not add tests and other stuff to the Anvil repository?

After reading this I thought “oops, I often add a Tests folder to the app repository, as described here and I may be doing the wrong thing!”

I like to add the folder to the app because I like to include the tests with the repository. I often have two repositories, one for the app with its Tests folder and one for the uplink with its Tests folder.

But, after reading @daviesian’s comment I am afraid that I am increasing the overhead for setting up the worker process, because that useless Tests folder is passed together with the useful app. I thought that the files were sitting somewhere in the server, I thought there was one copy of the app per used branch waiting to be used, but I was wrong.

I have a dedicated plan and all my apps keep the server running, so I assume that the performance hit (if there is any) only happens when a new instance is started, but this is not an excuse to be sloppy.

So my question is: is it better to add the Tests folder to the app as I am doing or is it better to keep it in another repository, for example in the cousin uplink repository?

1 Like

Short answer: You absolutely can (and should!) store things like tests, readme files, uplink scripts, Dockerfiles, etc in the App git repository. Keep doing what you’re doing!

Longer answer: Only the contents of the source code (.py and .yaml) files from the client_code and server_code directories in the repository are passed to the server worker processes, and even these are aggressively cached at every stage (based on the precise version of your app that is running). So there’s no need to avoid adding extra files to the repository :slight_smile:.

5 Likes

Thanks.

I will change my approach and use only one repository.

Right now I’m adding one Tests folder to the app repository, because the tests and the app code run together. But I often create 2 more repositories, one for the Uplink and one for the Excel file with the macros that is often associated with my apps. They are 3 distinct repositories, but they are on the same folder on my pc and I manage them with PyCharm, so they feel like one.

Since I have your blessing, from now on I will add the folders Tests, Uplink and Excel to the app, so there will be only one repository.