strong-toothbrush-37759
09/23/2022, 11:50 AMTest
in 500ms...` loop while trying to run multiple tests. I was AFK for about 20 minutes and came back to this (thread).
Any experience here or any good advice?❯ p test src/core/tests/
13:24:17.25 [INFO] Completed: Run Pytest - src/core/tests/test_feedback.py:tests0 succeeded.
13:24:25.86 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
13:24:26.87 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
13:25:25.85 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
...
13:30:25.86 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
...
13:48:26.89 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
tmux
-> fish-shell
-> <http://startship.rs|startship.rs>
promptwide-midnight-78598
09/23/2022, 11:56 AMpython_test
target include anything other than .py
files?strong-toothbrush-37759
09/23/2022, 11:57 AMsrc/core/tests/BUILD
contains:
python_sources(
dependencies=[
"src/config",
"src:requirements.txt#periodiq",
"src:requirements.txt#django-extensions",
],
)
python_tests(
name="tests0",
dependencies=[
"src/config",
],
)
./pants dependencies src/core/tests/
:
src/config/__init__.py
src/config/admin.py
src/config/apps.py
src/config/asgi.py
src/config/gunicorn.py
src/config/settings.py
src/config/settings_production.py
src/config/settings_staging.py
src/config/settings_testing.py
src/config/urls.py
src/config/wsgi.py
src/conftest.py:test_utils
src/core/__init__.py
src/core/models/__init__.py
src/core/tests/factories/__init__.py
src:requirements-dev.txt#Faker
src:requirements-dev.txt#factory-boy
src:requirements-dev.txt#pytest
src:requirements.txt#django-extensions
src:requirements.txt#periodiq
To clarify dependencieswide-midnight-78598
09/23/2022, 11:59 AMstrong-toothbrush-37759
09/23/2022, 12:00 PMwide-midnight-78598
09/23/2022, 12:00 PMstrong-toothbrush-37759
09/23/2022, 12:01 PM@pytest.mark.django_db()
def test_company_complete_factory():
data = CompanyCompleteFactory.create_batch(5)
assert len(data) == 5
wide-midnight-78598
09/23/2022, 12:01 PMp
an alias? Or a wrapper?strong-toothbrush-37759
09/23/2022, 12:02 PMalias p "./pants"
😄wide-midnight-78598
09/23/2022, 12:04 PM./pants test src/core/tests/
vs something like
./pants test src/core::
I assume not, but I can't remember having tested it beforestrong-toothbrush-37759
09/23/2022, 12:05 PM❯ p test src/core/tests:tests0
14:05:12.26 [INFO] Completed: Run Pytest - src/core/tests/test_feedback.py:tests0 succeeded.
14:05:25.86 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
14:05:26.84 [INFO] Filesystem changed during run: retrying `Test` in 500ms...
⠉ 11.65s Run Pytest for src/core/tests/test_study.py:tests0
⠉ 11.65s Run Pytest for src/core/tests/test_companies.py:tests0
⠉ 11.65s Run Pytest for src/core/tests/test_tenant.py:tests0
I think it renders the same results.wide-midnight-78598
09/23/2022, 12:06 PMstrong-toothbrush-37759
09/23/2022, 12:06 PM2.13.0
wide-midnight-78598
09/23/2022, 12:10 PMstrong-toothbrush-37759
09/23/2022, 12:10 PMwide-midnight-78598
09/23/2022, 12:11 PMstrong-toothbrush-37759
09/23/2022, 12:15 PMbitter-ability-32190
09/23/2022, 12:19 PM.pants.d/pants.log
usually has a log line pertaining to the file which inotify has told pants has changedstrong-toothbrush-37759
09/23/2022, 12:20 PM.pants.d/pants.log
:
14:19:46.60 [INFO] handling request: `--pants-bin-name=/<projectfolder>/pants --pants-version=2.13.0 test src/core/tests:tests0`
14:20:04.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".git/FETCH_HEAD", ".git"}
14:20:04.93 [INFO] notify invalidation: cleared 1 and dirtied 1381 nodes for: {".git", ".git/FETCH_HEAD"}
14:20:05.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".git/FETCH_HEAD"}
14:20:05.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".git/FETCH_HEAD"}
14:20:05.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".git/objects", ".git/objects/maintenance.lock"}
14:20:05.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".git/objects", ".git/objects/maintenance.lock"}
14:20:05.93 [INFO] notify invalidation: cleared 1 and dirtied 1381 nodes for: {".git/objects/maintenance.lock", ".git/objects"}
14:20:05.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".git/objects", ".git/objects/maintenance.lock"}
🤔bitter-ability-32190
09/23/2022, 12:23 PMstrong-toothbrush-37759
09/23/2022, 12:23 PM.gitignore
@ root:
# Pants workspace files
/.pants.d/
/dist
/.pids
/.pants.workdir.file_lock*
wide-midnight-78598
09/23/2022, 12:39 PM.git
for changes?lazygit
is modifying stuff in the git folder at that frequencystrong-toothbrush-37759
09/23/2022, 12:55 PMgit status
while pants command is running is triggering the “file changed” event handler btw. 😅bitter-ability-32190
09/23/2022, 1:12 PMpants_ignore
? https://www.pantsbuild.org/docs/reference-globalstrong-toothbrush-37759
09/23/2022, 1:14 PMpants_ignore
variable.bitter-ability-32190
09/23/2022, 1:14 PMpants_ignore.add = ...
wide-midnight-78598
09/23/2022, 1:19 PMIt should be excluding all dot files and dirs by defauktThanks for pointing out this default, I was just going through an existential crisis
happy-kitchen-89482
09/23/2022, 1:20 PMstrong-toothbrush-37759
09/23/2022, 1:21 PMpants_ignore.add = [
"*.md",
]
happy-kitchen-89482
09/23/2022, 1:21 PMpants_ignore = [...]
before? That is a common gotcha alasstrong-toothbrush-37759
09/23/2022, 1:23 PM.add
before.
Unfortunately it does not do what it is told 😄
My ignores:
pants_ignore.add = [
"/apps/",
"/src/bin",
"/src/docker",
"/frontend/",
"/python/",
".idea/",
"*.md",
]
I’m starting a test, changing a Markdown file, and the test restarts.
15:21:26.37 [INFO] handling request: `--pants-bin-name=/Users/vader/dev/sntls/osiris/pants --pants-version=2.13.0 test src/core/::`
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~", ""}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~", ""}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", "pants-TODOS.md~"}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", "pants-TODOS.md~"}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~"}
15:21:29.62 [INFO] notify invalidation: cleared 1 and dirtied 6069 nodes for: {"", "pants-TODOS.md~"}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~", ""}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~", ""}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~", ""}
15:21:29.62 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"pants-TODOS.md~"}
15:21:31.21 [INFO] request completed: `--pants-bin-name=/Users/vader/dev/sntls/osiris/pants --pants-version=2.13.0 test src/core/::`
wide-midnight-78598
09/23/2022, 1:23 PMpants_ignore = [...]
type of configuration error in a few other places, it's a very common problem in some subsystems too***/*.md
?*./md*
strong-toothbrush-37759
09/23/2022, 1:24 PMwide-midnight-78598
09/23/2022, 1:24 PMstrong-toothbrush-37759
09/23/2022, 1:25 PMwide-midnight-78598
09/23/2022, 1:25 PM"pants-TODOS.md~"
strong-toothbrush-37759
09/23/2022, 1:26 PMwide-midnight-78598
09/23/2022, 1:28 PMstrong-toothbrush-37759
09/23/2022, 1:28 PMpants_ignore.add
solves my issue, thanks everyone! 👏wide-midnight-78598
09/23/2022, 1:29 PM*~
.DS_Store
But those wouldn't be picked up it seems by a default pants_ignore
or the pants_ignore_use_gitignore
happy-kitchen-89482
09/23/2022, 2:09 PMbitter-ability-32190
09/23/2022, 2:09 PMYou likely don't want to set this directly but use Pants' <https://www.pantsbuild.org/docs/options#addremove-semantics
|add/remove semantics> for list options. E.g.pants_ignore.add = [...]
wide-midnight-78598
09/23/2022, 2:42 PMbitter-ability-32190
09/23/2022, 2:43 PMwide-midnight-78598
09/23/2022, 2:44 PMstrong-toothbrush-37759
09/23/2022, 2:55 PM{
"$schema": "<https://json.schemastore.org/tsconfig>",
"compilerOptions": {
"esModuleInterop": true,
"jsx": "react-jsx"
},
"exclude": [
"node_modules"
]
}
You get autocomplete for free in most of the editors.
Does something similar exist for toml? 🤔bitter-ability-32190
09/23/2022, 2:56 PMstrong-toothbrush-37759
09/23/2022, 2:57 PMbitter-ability-32190
09/23/2022, 2:58 PM