test: verify that configuration is loaded correctly #1312

Merged
mfenniak merged 2 commits from aahlenst/runner:config-tests into main 2026-01-22 16:17:08 +00:00
Member

Adds tests that verify that the runner configuration is loaded correctly, with and without a configuration file.

  • other
    • PR: test: verify that configuration is loaded correctly
Adds tests that verify that the runner configuration is loaded correctly, with and without a configuration file. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/1312): <!--number 1312 --><!--line 0 --><!--description dGVzdDogdmVyaWZ5IHRoYXQgY29uZmlndXJhdGlvbiBpcyBsb2FkZWQgY29ycmVjdGx5-->test: verify that configuration is loaded correctly<!--description--> <!--end release-notes-assistant-->
test: remove redundant tests
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 37s
checks / validate mocks (pull_request) Successful in 44s
checks / Build Forgejo Runner (pull_request) Successful in 44s
checks / runner exec tests (pull_request) Successful in 32s
checks / Build unsupported platforms (pull_request) Successful in 59s
checks / integration tests (docker-latest) (pull_request) Successful in 8m52s
checks / integration tests (docker-stable) (pull_request) Successful in 11m19s
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 10s
a827a06bdb
Author
Member

The tests do not cover compatibleWithOldEnvs() which has been deprecated for almost three years. NetworkMode is only tested lightly for the same reason. I'd prefer removing them instead of adding tests. When would be a good time for that?

I thought about converting LoadDefault() to functional options so that we can write Load() (would produce the default configuration) or Load(FromFile("path/to/runner/configuration")). It would be more flexible and easier to test. However, it doesn't mix well with the lower part of LoadDefault() that silently converts invalid values into default values which in itself is a problem.

It's likely that there's more room for improvement. I'm happy to improve the state of affairs but I need some inspiration.

The tests do not cover `compatibleWithOldEnvs()` which has been deprecated for almost three years. `NetworkMode` is only tested lightly for the same reason. I'd prefer removing them instead of adding tests. When would be a good time for that? I thought about converting `LoadDefault()` to functional options so that we can write `Load()` (would produce the default configuration) or `Load(FromFile("path/to/runner/configuration"))`. It would be more flexible and easier to test. However, it doesn't mix well with the lower part of `LoadDefault()` that silently converts invalid values into default values which in itself is a problem. It's likely that there's more room for improvement. I'm happy to improve the state of affairs but I need some inspiration.
mfenniak approved these changes 2026-01-22 16:16:57 +00:00
Owner

@aahlenst wrote in #1312 (comment):

The tests do not cover compatibleWithOldEnvs() which has been deprecated for almost three years. NetworkMode is only tested lightly for the same reason. I'd prefer removing them instead of adding tests. When would be a good time for that?

My first thought is to create a PR that removes them and we can bundle it with the next time we're forced to do a major release for a breaking change, and we can time-limit it and release it in a few months if nothing else comes up to force it. But if you're going to be active in this area for other changes, the open PR may be conflict prone.

I have the overall feeling that we're annoying users with major releases, even though it's been a couple months since the last. But until this recent 12.x period, they were somewhat aggressive, and I think I'm still trying to avoid them to prevent inflaming that annoyance.

@aahlenst wrote in https://code.forgejo.org/forgejo/runner/pulls/1312#issuecomment-74675: > The tests do not cover `compatibleWithOldEnvs()` which has been deprecated for almost three years. `NetworkMode` is only tested lightly for the same reason. I'd prefer removing them instead of adding tests. When would be a good time for that? My first thought is to create a PR that removes them and we can bundle it with the next time we're forced to do a major release for a breaking change, and we can time-limit it and release it in a few months if nothing else comes up to force it. But if you're going to be active in this area for other changes, the open PR may be conflict prone. I have the overall feeling that we're annoying users with major releases, even though it's been a couple months since the last. But until this recent 12.x period, they were somewhat aggressive, and I think I'm still trying to avoid them to prevent inflaming that annoyance.
Author
Member

@mfenniak wrote in #1312 (comment):

My first thought is to create a PR that removes them and we can bundle it with the next time we're forced to do a major release for a breaking change, and we can time-limit it and release it in a few months if nothing else comes up to force it. But if you're going to be active in this area for other changes, the open PR may be conflict prone.

For the moment, it might be sufficient to collect those in an issue and remove the deprecated code shortly before a major release. We only have to remember to do it.

I have the overall feeling that we're annoying users with major releases, even though it's been a couple months since the last. But until this recent 12.x period, they were somewhat aggressive, and I think I'm still trying to avoid them to prevent inflaming that annoyance.

Less churn is good. Even one minor release per month is a bit much. It also gives us less time to play around with new features. On the other hand, we seem to need more releases to get newer versions of jobparser into Forgejo.

@mfenniak wrote in https://code.forgejo.org/forgejo/runner/pulls/1312#issuecomment-74942: > My first thought is to create a PR that removes them and we can bundle it with the next time we're forced to do a major release for a breaking change, and we can time-limit it and release it in a few months if nothing else comes up to force it. But if you're going to be active in this area for other changes, the open PR may be conflict prone. For the moment, it might be sufficient to collect those in an issue and remove the deprecated code shortly before a major release. We only have to remember to do it. > I have the overall feeling that we're annoying users with major releases, even though it's been a couple months since the last. But until this recent 12.x period, they were somewhat aggressive, and I think I'm still trying to avoid them to prevent inflaming that annoyance. Less churn is good. Even one minor release per month is a bit much. It also gives us less time to play around with new features. On the other hand, we seem to need more releases to get newer versions of jobparser into Forgejo.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner!1312
No description provided.