This then takes over 8 minutes to run, each and every time… It seem like every time it builds the .tox\dist\homeassistant-0.98.0.dev0.zip file (takes a while) and then runs throuh:
Yes I discovered the same thing. With VSC container we have already an autonomous container to run tests. Using tox is like creating a container in a container… Useless
I have other issues link to container: with git commands which are very long to return results. Do you notice it too?
Yes I do notice that. Especially f you run tox… while it builds the ZIP file (outside the .tox) directory, git goes in meltdown (over 5K changes - ‘some git features will be disabled’). And checkins take a while too as it runs black as a pre-commit hook, which sees to run slow across the dev-container bridge.
Also if I look in the git log I see a lot of this:
Failed to watch ref '/workspaces/home-assistant/.git/refs/remotes/origin/dev', is most likely packed.
Error: ENOENT: no such file or directory, watch '/workspaces/home-assistant/.git/refs/remotes/origin/dev'
at FSWatcher.start (internal/fs/watchers.js:164:26)
at Object.watch (fs.js:1232:11)
at Object.t.watch (/root/.vscode-server/bin/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8/extensions/git/dist/main.js:1:6857)
at E.updateTransientWatchers (/root/.vscode-server/bin/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8/extensions/git/dist/main.js:1:97370)
at u.fire (/root/.vscode-server/bin/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8/out/vs/server/remoteExtensionHostProcess.js:50:227)
at T.updateModelState (/root/.vscode-server/bin/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8/extensions/git/dist/main.js:1:114750)
at process._tickCallback (internal/process/next_tick.js:68:7)
Not sure what the problem is there, because if I run git remote --verbose outside the container, I get a correct response:
I managed to get all my dev work done in the VSCode Dev Container… I did run test manually in the console using the pytest ... command above (and variants)… and checking in using the pre-commit hook … soooo slow!!
Now I am ready to create a PR but I have to run tox before I can submit it… So I killed VSCode and started a terminal session to the docker container using:
docker exec -it :container_id bash
where :container_id is the name of your running container (use the docker ps command to list all running containers. The :container_id is at the end of the line)…
I then changed to the /workplaces/home-assistant directory and ran tox… still too a long time, but was not overburdened with VSCode constantly polling git for changes…
Ran smoother with fewer failing tests… I still have 4 failing tests that are not related to my changes!!!
I am developing on Mac hat is supplied by my employer, so don’t want to pollute it with all the dependencies (I know… virualenv and all that)… so that’s why I prefer to use docker and the code/dev-container integration makes it work pretty well (except the git sync stuff that is a bit slow, especially during tox builds)…