mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 06:19:20 +08:00
feat: Integrate Comprehensive E2E Testing for GoChat (#1906)
* feat: create e2e test readme Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: fix markdown file * feat: add openim make lint * feat: add git chglog pull request * feat: add git chglog pull request * fix: fix openim api err code * fix: fix openim api err code * fix: fix openim api err code * feat: Improve CICD * feat: Combining GitHub and Google Workspace for Effective Project Management' * feat: fix openim tools error code * feat: fix openim tools error code * feat: add openim error handle * feat: add openim error handle * feat: optimize tim white prom code return err * feat: fix openim tools error code * style: format openim server code style * feat: add openim optimize commit code * feat: add openim optimize commit code * feat: add openim auto format code * feat: add openim auto format code * feat: add openim auto format code * feat: add openim auto format code * feat: add openim auto format code * feat: format openim code * feat: Some of the notes were translated * feat: Some of the notes were translated * feat: update openim server code * feat: optimize openim reset code * feat: optimize openim reset code --------- Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
package main
|
||||
@@ -128,6 +128,8 @@ Open issue: https://github.com/openimsdk/open-im-server/issues/new/choose, choos
|
||||
|
||||
The E2E test suite is integrated with CI, which runs the tests automatically on each code commit. The results are reported back to the pull request or commit to provide immediate feedback on the impact of the changes.
|
||||
|
||||
[](https://github.com/openimsdk/open-im-server/actions/workflows/e2e-test.yml)
|
||||
|
||||
|
||||
## Contact
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -58,20 +57,6 @@ type UserRegisterRequest struct {
|
||||
Users []User `json:"users"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Example usage of functions
|
||||
token, err := GetUserToken("openIM123456")
|
||||
if err != nil {
|
||||
log.Fatalf("Error getting user token: %v", err)
|
||||
}
|
||||
fmt.Println("Token:", token)
|
||||
|
||||
err = RegisterUser(token, "testUserID", "TestNickname", "https://example.com/image.jpg")
|
||||
if err != nil {
|
||||
log.Fatalf("Error registering user: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// GetUserToken requests a user token from the API.
|
||||
func GetUserToken(userID string) (string, error) {
|
||||
reqBody := UserTokenRequest{
|
||||
|
||||
@@ -76,7 +76,7 @@ func TestCopyFlags(t *testing.T) {
|
||||
}()
|
||||
CopyFlags(tt.args.source, tt.args.target)
|
||||
|
||||
// 验证复制的标记
|
||||
// Verify the replicated tag
|
||||
if !tt.wantErr {
|
||||
tt.args.source.VisitAll(func(f *flag.Flag) {
|
||||
if gotFlag := tt.args.target.Lookup(f.Name); gotFlag == nil || !reflect.DeepEqual(gotFlag, f) {
|
||||
|
||||
@@ -38,6 +38,9 @@ func main() {
|
||||
// }
|
||||
latestVersion := defaultTemplateVersion
|
||||
|
||||
// getLatestVersion
|
||||
// getLatestVersion
|
||||
|
||||
// Construct the download URL
|
||||
downloadURL := fmt.Sprintf("https://github.com/openimsdk/chat/releases/download/%s/chat_Linux_x86_64.tar.gz", latestVersion)
|
||||
|
||||
@@ -98,23 +101,23 @@ func main() {
|
||||
select {}
|
||||
}
|
||||
|
||||
// getLatestVersion fetches the latest version number from a given URL.
|
||||
func getLatestVersion(url string) (string, error) {
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
// // getLatestVersion fetches the latest version number from a given URL.
|
||||
// func getLatestVersion(url string) (string, error) {
|
||||
// resp, err := http.Get(url)
|
||||
// if err != nil {
|
||||
// return "", err
|
||||
// }
|
||||
// defer resp.Body.Close()
|
||||
|
||||
location := resp.Header.Get("Location")
|
||||
if location == "" {
|
||||
return defaultTemplateVersion, nil
|
||||
}
|
||||
// location := resp.Header.Get("Location")
|
||||
// if location == "" {
|
||||
// return defaultTemplateVersion, nil
|
||||
// }
|
||||
|
||||
// Extract the version number from the URL
|
||||
latestVersion := filepath.Base(location)
|
||||
return latestVersion, nil
|
||||
}
|
||||
// // Extract the version number from the URL
|
||||
// latestVersion := filepath.Base(location)
|
||||
// return latestVersion, nil
|
||||
// }
|
||||
|
||||
// downloadAndExtract downloads a file from a URL and extracts it to a destination directory.
|
||||
func downloadAndExtract(url, destDir string) error {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
package page
|
||||
@@ -0,0 +1 @@
|
||||
package page
|
||||
@@ -1 +0,0 @@
|
||||
.keep
|
||||
@@ -0,0 +1,2 @@
|
||||
# OpenIM Web E2E
|
||||
|
||||
Reference in New Issue
Block a user