Skip to content

Atlas native test runner#157

Open
elcritch wants to merge 16 commits into
nim-lang:masterfrom
elcritch:atlas-native-test
Open

Atlas native test runner#157
elcritch wants to merge 16 commits into
nim-lang:masterfrom
elcritch:atlas-native-test

Conversation

@elcritch

Copy link
Copy Markdown
Collaborator

Adds support for atlas test, atlas test --parallel, and atlas test tests/mytest.nim. Runs tests/t*.nim when no args are provided.

Note: no care is taken to separate test output in parallel mode. Use serial mode if you want serial output.

Comment thread doc/atlas.md Outdated
elcritch and others added 2 commits August 17, 2025 13:08
Co-authored-by: Andreas Rumpf <araq4k@proton.me>
@Araq

Araq commented Aug 18, 2025

Copy link
Copy Markdown
Member

Why do we need this? It's beyond Atlas's scope and doesn't fit in IMO.

@elcritch

elcritch commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator Author

Why do we need this? It's beyond Atlas's scope and doesn't fit in IMO.

It’s not beyond the original scope of Atlas. Narrowing down atlas’s scope has made sense IMO but not in this case.

This is needed so Atlas can function as a Nimble replacement since many repos rely on nimble test to run tests.

@elcritch

elcritch commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator Author

Hmmm though I just remembered there is testament. I just recall testament kinda “being meh” for some reason. As in confusing to use. Maybe that was the koch thing.

Honestly that opinion is vague and could be because I don’t favor having to remember too many of randomly named tools. Pretty sure I’m not unique in that. I like namespacing like nim test which could call testament or similar.

Perhaps having Atlas just call Testament instead?

@elcritch

Copy link
Copy Markdown
Collaborator Author

On the note of a nimble replacement, IMO Atlas should also support build again as well. Most of that is because adding atlas install && atlas build is far easier for the mayfly types who just want to quickly test a project or see it run or pass tests. It’s a terrible habit, but to be fair there’s so many options nowadays that a slight bit of friction at that stage and people will write off a project. I have done it myself.

@elcritch

Copy link
Copy Markdown
Collaborator Author

See, I might be too dumb to use Testament: https://gist.github.com/elcritch/2cae045ce132dfd34c703b6653560d71

Ugh I'll have to read the docs instead of running my tests. :P

@Araq

Araq commented Aug 18, 2025

Copy link
Copy Markdown
Member

Testament is not good indeed, Nimony uses a new tool named "hastur" instead. So if Atlas provides a test command, it indeed makes sense to copy Nimble here.

The problem here is that Atlas's design says "it won't call Nim for you", it merely sets up a nim.cfg. atlas test and atlas doc and atlas build violate this.

If we treat Atlas as a Nimble replacement all these things make perfect sense, of course.

@elcritch

Copy link
Copy Markdown
Collaborator Author

The problem here is that Atlas's design says "it won't call Nim for you", it merely sets up a nim.cfg. atlas test and atlas doc and atlas build violate this.

True, and I do like that. I also want a simple way to run tests.

Perhaps adding a nim test to Nim itself? Adding it to Nim itself could make sense, but gets contaminates separation of concerns there as well.

@elcritch

Copy link
Copy Markdown
Collaborator Author

What if test was a sort of plugin? Essentially Atlas could support plugins for running cmake, or running nim tests, etc.

Then technically it's not Atlas invoking Nim, but another tool/plugin.

@Araq

Araq commented Aug 18, 2025

Copy link
Copy Markdown
Member

Maybe a separate atlasrun tool? (Part of this repo, of course.)

@mratsim

mratsim commented Feb 3, 2026

Copy link
Copy Markdown

The problem here is that Atlas's design says "it won't call Nim for you", it merely sets up a nim.cfg. atlas test and atlas doc and atlas build violate this.

If we treat Atlas as a Nimble replacement all these things make perfect sense, of course.

Having something that deals with all the devops is quite valuable, similar to go build (hiding cgo) or cargo build (hiding rustc).

@Araq

Araq commented Feb 3, 2026

Copy link
Copy Markdown
Member

Atlas is a package manager, not a build tool. If it becomes a build tool it needs to support every option that Nim supports, this can be done in some half-assed broken manner as Nimble does it or via a new --forward:switch:arg command line argument.

@elcritch

elcritch commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator Author

Having something that deals with all the devops is quite valuable, similar to go build (hiding cgo) or cargo build (hiding rustc).

A separate tool like atlas-run or atlas-build could fill that role perhaps.

Though @mratsim it's surprisingly effective to add tasks like test or build in a top level config.nims. Then you can do nim test or nim build.

If it becomes a build tool it needs to support every option that Nim supports, this can be done in some half-assed broken manner as Nimble does it or via a new --forward:switch:arg command line argument.

A standard way in many programs is with a --. As in atlas-build test -- -d:release or some such. So much simpler than some --forward. Alternatively, atlas-build would just build and any args would be passed along.

@Araq

Araq commented Feb 5, 2026

Copy link
Copy Markdown
Member

atlas-build sounds very good to me.

@ryanwalklin

Copy link
Copy Markdown

Seconding an atlas build command, I've got a bunch of subprojects as atlas dependencies (Vulkan engine for a visualisation app I'm building) that themselves need to run steps (download fonts, build C libraries, generate Futhark FFI etc), that I'm currently duk-taping config.nims scripts together for, and a more robust build system would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants