I'm having trouble getting incremental testing working in github actions and wonder if someone could help me. I have the checkout action using depth 0 and fetch-tags true and it looks like it's pulling enough git history to figure out an increment. In fact, I added a poly info to my workflow and it says stable since: ..., but when I run poly test :projects project:... it looks to be running all the tests, whereas locally it runs zero tests (because I've only changed non-code files on this branch).
Figured it out. I thought poly diff was the same locally and in CI, but in CI it includes the logging component change (which is setting up different logging by copying a file over top of another) since the logging component is used everywhere all the tests run!
When I removed that I got an incremental test run.
Sounds like a good candidate for profiles and multiple component implementations of a single interface...?
having different logging in CI?
Sure, since you can select profiles on any poly command. Isolate the logging differences in a component. No need to copy files around.
it's really just a configuration difference, but I suppose the config could become different components each with a different config and use profiles to chose the component for the right env
I usually manage that stuff by modifying the classpath (or in this case copying a file which obviously wasn't ideal), but profiles are a way to modify the classpath 🙂
If it's just a config difference, you can use an env var to specify that?
Hmm, I guess you'd be running tests against projects so profiles wouldn't work for that, only for :dev.
We have multiple logging configs checked into source control and use env vars to select the appropriate one as needed.
(mind you, that's going to depend on what logging library you use I expect -- we are all-in on log4j2)
we do the same but force the logging library's choice via classpath construction
these are all good thoughts. I haven't given much love to CI until recently, but there are obviously improvements that could make life more plesant (for prod too)
how can I get a better idea of what it thinks the increment is, or how it is making the decision about what tests to run?
If you run poly info :projects then my guess is that these projects after project:... will be marked to be tested (`--x` ). If any file under a project is changed, then the project will be marked to be tested.
I'm running titan-backend
stable since: 02c02c8 | dev-20250923T165948
projects: 4 interfaces: 62
bases: 4 components: 62
active profiles: default
project alias status dev
-------------------------------- ---
demeter-backend + db --- ---
spreadsheet + ss --- ---
titan-backend + tb --- ---
development + dev s-- s--incremental testing works fine locally. It seems clear there's something different in the CI environment. I just don't know what it is and I'm at the end of my ideas for how to figure it out.
This is what poly diff says in CI
.github/workflows/backend-lint-and-test.yml
.github/workflows/cd.yml
.secrets.edn
components/logging/test-resources/logback-test-ci.xml
components/logging/test-resources/logback-test.xml
components/minos/src/titan/minos/interface.clj
deps.edn
workspace-ci.edn
workspace.edn
then it proceeds to run tests for 38 bricksAre you pushing the stable tag?
At work, our ci tags each successful build, so each run is only what's changed since the last successful ci
Try running this command locally and in CI to verify that you get the same result: ws get:changes:git-diff-command