mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-22 22:28:51 +01: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()
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user