mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 03:47:54 +02:00
Mark all github action tests as integration test devices
This commit is contained in:
parent
0a3346435d
commit
a1d1c779d5
@ -590,7 +590,7 @@ func setup(userSecret string, isOffline bool) error {
|
|||||||
}
|
}
|
||||||
ctx := hctx.MakeContext()
|
ctx := hctx.MakeContext()
|
||||||
registerPath := "/api/v1/register?user_id=" + data.UserId(userSecret) + "&device_id=" + config.DeviceId
|
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"
|
registerPath += "&is_integration_test_device=true"
|
||||||
}
|
}
|
||||||
_, err = lib.ApiGet(ctx, registerPath)
|
_, err = lib.ApiGet(ctx, registerPath)
|
||||||
@ -619,6 +619,16 @@ func setup(userSecret string, isOffline bool) error {
|
|||||||
return nil
|
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() {
|
func init() {
|
||||||
rootCmd.AddCommand(installCmd)
|
rootCmd.AddCommand(installCmd)
|
||||||
rootCmd.AddCommand(initCmd)
|
rootCmd.AddCommand(initCmd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user