Allow marking tests to be skipped (#16528)
This commit is contained in:
parent
ec1f09307c
commit
8cc3b0f4d2
21 changed files with 38 additions and 20 deletions
|
|
@ -23,7 +23,8 @@ var acceptable = []string{
|
|||
"loadpoint 1 is not configured", // openWB
|
||||
"recv timeout",
|
||||
"(Client.Timeout exceeded while awaiting headers)",
|
||||
"can only have either uri or device", // modbus
|
||||
"can only have either uri or device", // modbus
|
||||
"connection already registered with different protocol: localhost:502", // modbus
|
||||
"sponsorship required, see https://github.com/evcc-io/evcc#sponsorship",
|
||||
"eebus not configured",
|
||||
"context deadline exceeded",
|
||||
|
|
|
|||
|
|
@ -23,12 +23,13 @@ var acceptable = []string{
|
|||
"i/o timeout",
|
||||
"'sma': missing uri or serial", // SMA
|
||||
"[1ESY1161052714 1ESY1161229249 1EMH0008842285 1ESY1161978584 1EMH0004864048 1ESY1161979033 7ELS8135823805]", // Discovergy
|
||||
"can only have either uri or device", // modbus
|
||||
"(Client.Timeout exceeded while awaiting headers)", // http
|
||||
"context deadline exceeded", // LG ESS
|
||||
"no ping response for 192.0.2.2", // SMA
|
||||
"no such network interface", // SMA
|
||||
"missing config values: username, password, key", // E3DC
|
||||
"can only have either uri or device", // modbus
|
||||
"connection already registered with different protocol: localhost:502", // modbus
|
||||
"(Client.Timeout exceeded while awaiting headers)", // http
|
||||
"context deadline exceeded", // LG ESS
|
||||
"no ping response for 192.0.2.2", // SMA
|
||||
"no such network interface", // SMA
|
||||
"missing config values: username, password, key", // E3DC
|
||||
}
|
||||
|
||||
func TestTemplates(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ products:
|
|||
description:
|
||||
generic: TerraAC
|
||||
requirements:
|
||||
evcc: ["sponsorship"]
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
render: |
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ products:
|
|||
description:
|
||||
generic: Elvi
|
||||
requirements:
|
||||
evcc: ["sponsorship"]
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
- name: meter
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ products:
|
|||
- brand: Fronius
|
||||
description:
|
||||
generic: Wattpilot (OCPP)
|
||||
requirements:
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
render: |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ requirements:
|
|||
The charger must be equipped with a built-in meter (models HC11L/HC22L Energy or Profi).
|
||||
For the OCPP configuration, you need to access the EFR-SECC charge controller at http://host/secc.
|
||||
For login credentials, ask your dealer or the vendor EFR (www.efr.de).
|
||||
evcc: ["sponsorship"]
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
render: |
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ products:
|
|||
description:
|
||||
generic: Viaris
|
||||
requirements:
|
||||
evcc: ["sponsorship"]
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
render: |
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ requirements:
|
|||
* URL: ws://[evcc-adresse]:8887/ (local network connection)
|
||||
* Charge Point Identity: Custom value (e.g. serial number of charger) which is reused in configuration as *stationid*
|
||||
* Password: leave empty
|
||||
evcc: ["sponsorship"]
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
render: |
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ requirements:
|
|||
* Local network connection
|
||||
|
||||
The specific configuration and the actual usable functionality depend on the charger model and its software.
|
||||
evcc: ["sponsorship"]
|
||||
evcc: ["sponsorship", "skiptest"]
|
||||
params:
|
||||
- preset: ocpp
|
||||
- name: autostart
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ requirements:
|
|||
description:
|
||||
en: WARP Firmware v2 required. Automatic phase switching requires the additional WARP Energy Manager.
|
||||
de: WARP Firmware v2 erforderlich. Für automatische Phasenumschaltung wird zusätzlich der WARP Energy Manager benötigt.
|
||||
evcc: ["skiptest"]
|
||||
params:
|
||||
- preset: mqtt
|
||||
- name: topic
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ requirements:
|
|||
description:
|
||||
de: Die automatische Phasenumschaltung bei 1p Fahrzeugen muss deaktiviert sein. Siehe https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3.
|
||||
en: The automatic phase switching for 1p vehicles must be deactivated. Siehe https://docs.warp-charger.com/docs/mqtt_http/api_reference/evse#evse_phase_auto_switch_warp3.
|
||||
evcc: ["skiptest"]
|
||||
params:
|
||||
- preset: mqtt
|
||||
- name: topic
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ products:
|
|||
- brand: Solaranzeige
|
||||
description:
|
||||
generic: Solaranzeige
|
||||
requirements:
|
||||
evcc: ["skiptest"]
|
||||
params:
|
||||
- name: usage
|
||||
choice: ["grid", "pv"]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ products:
|
|||
- brand: Tibber
|
||||
description:
|
||||
generic: Pulse
|
||||
requirements:
|
||||
evcc: ["skiptest"]
|
||||
params:
|
||||
- name: usage
|
||||
choice: ["grid"]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ products:
|
|||
- brand: Volkszähler
|
||||
description:
|
||||
generic: WebSocket API
|
||||
requirements:
|
||||
evcc: ["skiptest"]
|
||||
group: generic
|
||||
params:
|
||||
- name: usage
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ requirements:
|
|||
description:
|
||||
de: "CO₂-Daten für viele Länder von https://electricitymaps.com/. Der 'Free Personal Tier' beinhaltet leider keine Prognosedaten. Dafür benötigst du einen kommerziellen Account von https://api-portal.electricitymaps.com/. Kostenloser Testmonat verfügbar."
|
||||
en: "CO₂ data for many countries from https://electricitymaps.com/. The 'Free Personal Tier' unfortunately does not include forecast data. You'll need a commercial account from https://api-portal.electricitymaps.com/. Free trial available."
|
||||
evcc: ["skiptest"]
|
||||
group: co2
|
||||
params:
|
||||
- name: uri
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ requirements:
|
|||
description:
|
||||
de: "Nur für die Schweiz verfügbar."
|
||||
en: "Only available for Switzerland."
|
||||
evcc: ["skiptest"]
|
||||
group: price
|
||||
params:
|
||||
- preset: tariff-base
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ requirements:
|
|||
description:
|
||||
de: "Regionale Emissionsdaten von https://gruenstromindex.de. Nur für Deutschland verfügbar."
|
||||
en: "Regional emission data from https://gruenstromindex.de. Only available for Germany."
|
||||
evcc: ["skiptest"]
|
||||
group: co2
|
||||
params:
|
||||
- name: zip
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ requirements:
|
|||
description:
|
||||
en: "Get your API token from the Tibber developer portal: https://developer.tibber.com/"
|
||||
de: "Hol dir deinen API-Token aus dem Tibber-Entwicklerportal: https://developer.tibber.com/"
|
||||
evcc: ["skiptest"]
|
||||
group: price
|
||||
params:
|
||||
- name: token
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package templates
|
|||
|
||||
import (
|
||||
"maps"
|
||||
"os"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
|
|
@ -27,10 +26,12 @@ func test(t *testing.T, tmpl Template, values map[string]interface{}, cb func(va
|
|||
return
|
||||
}
|
||||
|
||||
// actually run the instance if not on CI
|
||||
if os.Getenv("CI") == "" {
|
||||
cb(values)
|
||||
// don't execute if skip test is set
|
||||
if slices.Contains(tmpl.Requirements.EVCC, RequirementSkipTest) {
|
||||
return
|
||||
}
|
||||
|
||||
cb(values)
|
||||
}
|
||||
|
||||
func TestClass(t *testing.T, class Class, instantiate func(t *testing.T, values map[string]interface{})) {
|
||||
|
|
|
|||
|
|
@ -56,9 +56,10 @@ const (
|
|||
RequirementEEBUS = "eebus" // EEBUS Setup is required
|
||||
RequirementMQTT = "mqtt" // MQTT Setup is required
|
||||
RequirementSponsorship = "sponsorship" // Sponsorship is required
|
||||
RequirementSkipTest = "skiptest" // Template should be rendered but not tested
|
||||
)
|
||||
|
||||
var ValidRequirements = []string{RequirementEEBUS, RequirementMQTT, RequirementSponsorship}
|
||||
var ValidRequirements = []string{RequirementEEBUS, RequirementMQTT, RequirementSponsorship, RequirementSkipTest}
|
||||
|
||||
var predefinedTemplateProperties = []string{
|
||||
"type", "template", "name",
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ var acceptable = []string{
|
|||
"missing credentials", // Tesla
|
||||
"missing credentials id", // Tronity
|
||||
"missing access and/or refresh token, use `evcc token` to create", // Tesla
|
||||
"login failed: code not found", //Polestar
|
||||
"login failed: code not found", // Polestar
|
||||
"empty instance type- check for missing usage", // Merces
|
||||
"invalid vehicle type: tesla", //Tesla
|
||||
"invalid vehicle type: tesla", // Tesla
|
||||
}
|
||||
|
||||
func TestTemplates(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue