Sublime Forum

Any Docker image for UnitTesting?

#1

Hi!

Currently, we probably all use UnitTesting which is great and performant. Typical CI service is Travis. Now, Travis itself is not that slow (at least often) but the test script we have to use makes it very slow. I mean the runtime is ~2min as a minimum, the actual tests take 20sec at a max.

I actually can recreate this Travis setup using docker on my local machine. I just use the travis image as a start and then run our scripts. But this is just as slow as running it on the Travis hardware. (A bit more reliable though.)

This has other drawbacks: The Travis images are huge, I mean huuuge. And they don’t publish them. So you cannot reference travis-codename:latest etc.

What I would like is a small image, maybe starting from ubuntu:latest, ideally something anyone has on their computer or the cloud anyway. But I just couldn’t get it to run. Sublime just doesn’t run in the same way, usually it can’t even install PackageControl. And I’m actually dumb when it comes to docker or linux, and we’re headless anyway so I don’t get error messages. Wouldn’t know where to look for them anyway.

Say, it was a horrible unproductive journey.

Anyone has this running. Or knows someone in DevRel?

Ideally I would say we could start as I said from a well-shared, common minimal linux distro. Maybe ubuntu:x.

We then extend and publish something like sublime-headless-unittesting:buildnumber and :latest. Because installing Sublime and PackageControl on each invocation/run is what makes everything so slow.

WDYT?

1 Like

#2

We used to support vagrant https://github.com/randy3k/UnitTesting-example/blob/43b67c7bfcc40c4bcfed0d72538b6c18430d6420/README.md#vagrant

However, as I am not using it anymore so the code is no longer maintained.

Let me see if I could do anything.

1 Like

#3

One difference I immediately see is you do

XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"

whereby I always tried with

XVFBARGS="$DISPLAY -ac -screen 0 1024x768x16 +extension RANDR"

0 Likes

#4

I copied the script from somewhere but it worked.

0 Likes

#5

@herr.kaste

I have successfully built a docker image for UnitTesting, checkout https://github.com/randy3k/UnitTesting-Docker

Originally, it didn’t work for me and I could’t see why. At the end, I installed an vnc server and discovered this.

Setting the locale fixed the error immediately

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

This is what I got by running UnitTesting docker image to test GitSavvy.

1 Like

#6

There is still a lot of improvement that could be done. For example, one could pre-install Sublime Text in the image.

But I’m done now as I don’t think I will use it very often. @herr.kaste, please feel free to clone and make your own changes.

0 Likes

#7

Just waiting for the rainy day

0 Likes

#8

I have decided to move the Dockerfile to UnitTesting as we will need it for github actions.

0 Likes

#9

So you basically had a whole rainy week. :grin:

Some caching would be nice though to sped things up.

0 Likes