[tests] Remote packages with substitutions (#12145)

This commit is contained in:
Javier Peletier
2025-11-28 12:15:55 -06:00
committed by GitHub
parent fb82362e9c
commit e15f3a08ae
7 changed files with 122 additions and 1 deletions
@@ -0,0 +1,25 @@
substitutions:
x: 10
y: 20
z: 30
values_from_repo1_main:
- package_name: package1
x: 3
y: 4
z: 5
volume: 60
- package_name: package2
x: 6
y: 7
z: 8
volume: 336
- package_name: default
x: 10
y: 20
z: 5
volume: 1000
- package_name: package4_from_repo2
x: 9
y: 10
z: 11
volume: 990
@@ -0,0 +1,37 @@
substitutions:
x: 10
y: 20
z: 30
packages:
package1:
url: https://github.com/esphome/repo1
files:
- path: file1.yaml
vars:
package_name: package1
x: 3
y: 4
ref: main
package2: !include # a package that just includes the given remote package
file: remote_package_proxy.yaml
vars:
url: https://github.com/esphome/repo1
ref: main
files:
- path: file1.yaml
vars:
package_name: package2
x: 6
y: 7
z: 8
package3: github://esphome/repo1/file1.yaml@main # a package that uses the shorthand syntax
package4: # include repo2, which itself includes repo1
url: https://github.com/esphome/repo2
files:
- path: file2.yaml
vars:
package_name: package4
a: 9
b: 10
c: 11
ref: main
@@ -0,0 +1,6 @@
# acts as a proxy to be able to include a remote package
# in which the url/ref/files come from a substitution
packages:
- url: ${url}
ref: ${ref}
files: ${files}
@@ -0,0 +1,3 @@
This folder contains fake repos for remote packages testing
These are used by `test_substitutions.py`.
To add repos, create a folder and add its path to the `REMOTES` constant in `test_substitutions.py`.
@@ -0,0 +1,9 @@
defaults:
z: 5
package_name: default
values_from_repo1_main:
- package_name: ${package_name}
x: ${x}
y: ${y}
z: ${z}
volume: ${x*y*z}
@@ -0,0 +1,10 @@
packages:
- url: https://github.com/esphome/repo1
ref: main
files:
- path: file1.yaml
vars:
package_name: ${package_name}_from_repo2
x: ${a}
y: ${b}
z: ${c}