Mark all github action tests as integration test devices

This commit is contained in:
David Dworken 2023-11-23 09:53:12 -08:00
parent 0a3346435d
commit a1d1c779d5
No known key found for this signature in database

View File

@ -590,7 +590,7 @@ func setup(userSecret string, isOffline bool) error {
}
ctx := hctx.MakeContext()
registerPath := "/api/v1/register?user_id=" + data.UserId(userSecret) + "&device_id=" + config.DeviceId
if os.Getenv("HISHTORY_TEST") != "" {
if isIntegrationTestDevice() {
registerPath += "&is_integration_test_device=true"
}
_, err = lib.ApiGet(ctx, registerPath)
@ -619,6 +619,16 @@ func setup(userSecret string, isOffline bool) error {
return nil
}
func isIntegrationTestDevice() bool {
if os.Getenv("HISHTORY_TEST") != "" {
return true
}
if os.Getenv("GITHUB_ACTION_REPOSITORY") == "ddworken/hishtory" {
return true
}
return false
}
func init() {
rootCmd.AddCommand(installCmd)
rootCmd.AddCommand(initCmd)