
### Description of the change This adds an environment for unit testing our bash scripts, using [BATS](https://github.com/bats-core/bats-core). It implements first tests for `config_environment.sh`. ### Benefits Writing unit tests for bash scripts documents the expected behavior and allows it being a quality gate in our CI. ### Possible drawbacks Not everyone is familiar with this approach and unit testing framework. Me neither, it took me some hours to get into it. ### Applicable issues - Related to #691 where an issue in `config_environment.sh` was detected. It doesn't fixes it yet. This will be a dedicated Pull Request. ### Additional information I've verified that the changes for Renovate are indeed working. You may wonder why there is only one `run $PROJECT_ROOT/scripts/init-containers/config/config_environment.sh` and many `run execute_test_script` calls. Usually, testing a script itself would be executing `run $PROJECT_ROOT/scripts/init-containers/config/config_environment.sh`. You then can assert the exit code and other things. Since the `config_environment.sh` exports environment variables and we are not able to access them from outside a `run` execution, the function `execute_test_script` wraps our script execution between environment comparison. Doing so allows us capture environment variables that were added/removed during script execution. Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/724 Reviewed-by: pat-s <pat-s@noreply.gitea.com> Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com> Co-committed-by: justusbunsi <sk.bunsenbrenner@gmail.com>
98 lines
2.6 KiB
Plaintext
98 lines
2.6 KiB
Plaintext
{
|
|
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
|
|
extends: [
|
|
'gitea>gitea/renovate-config',
|
|
':automergeMinor',
|
|
'schedule:automergeDaily',
|
|
'schedule:weekends',
|
|
],
|
|
labels: [
|
|
'kind/dependency',
|
|
],
|
|
automergeStrategy: 'squash',
|
|
'git-submodules': {
|
|
'enabled': true
|
|
},
|
|
customManagers: [
|
|
{
|
|
description: 'Gitea-version of https://docs.renovatebot.com/presets-regexManagers/#regexmanagersgithubactionsversions',
|
|
customType: 'regex',
|
|
fileMatch: [
|
|
'.gitea/workflows/.+\\.ya?ml$',
|
|
],
|
|
matchStrings: [
|
|
'# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?\\s+[A-Za-z0-9_]+?_VERSION\\s*:\\s*["\']?(?<currentValue>.+?)["\']?\\s',
|
|
],
|
|
},
|
|
{
|
|
description: 'Detect helm-unittest yaml schema file',
|
|
customType: 'regex',
|
|
fileMatch: ['.vscode/settings\\.json$'],
|
|
matchStrings: [
|
|
'https:\\/\\/raw\\.githubusercontent\\.com\\/(?<depName>[^\\s]+?)\\/(?<currentValue>v[0-9.]+?)\\/schema\\/helm-testsuite\\.json',
|
|
],
|
|
datasourceTemplate: 'github-releases',
|
|
},
|
|
{
|
|
'description': 'Automatically detect new Gitea releases',
|
|
'customType': 'regex',
|
|
'fileMatch': ['(^|/)Chart\\.yaml$'],
|
|
'matchStrings': [
|
|
'# renovate datasource=(?<datasource>\\S+) depName=(?<depName>\\S+) extractVersion=(?<extractVersion>\\S+)\\nappVersion:\\s?(?<currentValue>\\S+)\\n',
|
|
],
|
|
},
|
|
],
|
|
packageRules: [
|
|
{
|
|
groupName: 'subcharts (minor & patch)',
|
|
matchManagers: [
|
|
'helmv3',
|
|
],
|
|
matchUpdateTypes: [
|
|
'minor',
|
|
'patch',
|
|
'digest',
|
|
],
|
|
},
|
|
{
|
|
groupName: 'workflow dependencies (minor & patch)',
|
|
matchManagers: [
|
|
'github-actions',
|
|
'npm',
|
|
'custom.regex',
|
|
],
|
|
matchUpdateTypes: [
|
|
'minor',
|
|
'patch',
|
|
'digest',
|
|
],
|
|
matchFileNames: [
|
|
'!Chart.yaml',
|
|
],
|
|
},
|
|
{
|
|
description: 'Update README.md on changes in values.yaml',
|
|
matchManagers: [
|
|
'helm-values',
|
|
],
|
|
postUpgradeTasks: {
|
|
commands: [
|
|
'install-tool node',
|
|
'make readme',
|
|
],
|
|
fileFilters: [
|
|
'README.md',
|
|
],
|
|
executionMode: 'update',
|
|
},
|
|
},
|
|
{
|
|
description: 'Override changelog url for Helm image, to have release notes in our PRs',
|
|
matchDepNames: [
|
|
'alpine/helm',
|
|
],
|
|
changelogUrl: 'https://github.com/helm/helm',
|
|
},
|
|
],
|
|
}
|