Skip to content

Commit

Permalink
Sprint 1.14 (#1033)
Browse files Browse the repository at this point in the history
* go mod tidy

* Restricted blobber tests

* Changed repo snapshots

* Skipped authorizer tests

* add owner api calls (#1047)

* add owner api calls

* fix referral tests

* fix fcm, wallet tests

* fix shareinfo

* fix referral leaderboard, response messages

* fix lint

* fix lint

* Added feature blobber auth tests

* Fix API tests create allocation

* Updated gosdk

* Updated gosdk

* Fix

* Fix

* Fix blobber config update test =

* Fix blobber config update cleanup

* Fix

* Hotfix/0box (#1049)

* update headers

* remove phone header dependent tests

* fix lint

* Updated gosdk

* fix commit err message (#1052)

* fix commit err message

* change err msg

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix lint

* Fix

* tests to list stakable providers (#1036)

* tests to list stakable providers

* fix list miner and sharder

* apply gofmt

* fix getblobbers function parameter

* update gosdk version

* Update lint version to v1.57.1 ci.yml

* Update go version in lint job

* Updated gosdk

---------

Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: Jayash Satolia <jayash.satolia.min19@iitbhu.ac.in>

* Fix 0box tests with create allocation

* fix 0box tests

* Empty commit

* Fix restricted blobber tests

* Update gosdk

* Fix sharder config update

* fix delete wallet (#1057)

* Fixed file format and restricted blobbers test

* Fix resume upload

* Fix restricted blobbers

* fix resume download test (#1058)

* Fix restricted blobbers

* Fix restricted blobbers

* Fix restricted blobbers

* added repair allocation with diff file size (#1034)

* added repair allocation for diff file size

* added repair allocation for diff file size

* added repair allocation for diff file size

* added repair allocation for diff file size

* added repair allocation for diff file size

* added repair allocation for diff file size

* added repair allocation for diff file size

* added repair allocation for diff file size

* added TC

* added TC

* added TC

* added TC

* added TC

* updated timeout to 60 mins

* updated timeout to 60 mins

* updated pricing plan fetch for non-rzp org IDs

* added TC with nested folder

* added TC with nested folder

* added TC with nested folder

* added TC with nested folder

* added TC with nested folder

* added TC with nested folder

* added TC with nested folder

* fixed to current sprint branch in tokenomics_ci.yml

* Fix current branch for challenge nightly tests workflow

* Fix current branch for tokenomics nightly tests workflow

* Fix current branch for tokenomics nightly tests workflow

---------

Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: Jayash Satolia <jayash.satolia.min19@iitbhu.ac.in>

* Stats comparison (#1055)

* Compare stats eventsDB & MPT

* mpt storage retrieval details

* fetch individual provider details

* Fetch MPT, events DB data

* Updated blobbers fetch

* wallet ID added for MPT call

* fetch provider specific node details

* Blobber stats comparison

* Blobber stats assert

* Miner Sharder TC

* Blobber MPT to json

* fixed to current sprint branch in tokenomics_ci.yml

* Fix current branch for challenge nightly tests workflow

* Fix current branch for tokenomics nightly tests workflow

* Fix current branch for tokenomics nightly tests workflow

* Type conversion for nested maps

* Additional fields check added for providers

* Lint issues

* Comment formatting

* ignore comments - lint

* Whitespace issue - Lint

* Remove commented code - Lint

* Code restructure - Lint

* fmt handle err replaced with test logging

* Run in the very end

* Empty commit

* Revert workflow changes

---------

Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: Jayash Satolia <jayash.satolia.min19@iitbhu.ac.in>
Co-authored-by: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com>

* Fix lint

---------

Co-authored-by: Sanchit Sharma <47826073+Sanchit011@users.noreply.github.com>
Co-authored-by: Hitenjain14 <57557631+Hitenjain14@users.noreply.github.com>
Co-authored-by: Yury <yuderbasov@gmail.com>
Co-authored-by: Arun Ramanathan <arunmail12@gmail.com>
Co-authored-by: shahnawaz-creator <117025384+shahnawaz-creator@users.noreply.github.com>
Co-authored-by: sanchit <sanchit4242@gmail.com>
Co-authored-by: Gaurang Patel <gbp301195@gmail.com>
Co-authored-by: Cristal Wilson Lobo <143117888+CristalWilsonLobo@users.noreply.github.com>
  • Loading branch information
9 people committed May 6, 2024
1 parent 1729cb3 commit 55b3bab
Show file tree
Hide file tree
Showing 37 changed files with 2,022 additions and 1,029 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
- uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: '1.21'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
version: v1.57.1
skip-build-cache: true
skip-pkg-cache: true
only-new-issues: true
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ module github.com/0chain/system_test

go 1.21

toolchain go1.22.1

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.13.6
github.com/0chain/gosdk v1.14.0-RC2
github.com/go-resty/resty/v2 v2.7.0
github.com/herumi/bls-go-binary v1.31.0
github.com/shopspring/decimal v1.3.1
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs
github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.13.6 h1:uPd3Hp63bk8utVzIxZnYl981/SsblTwIHMBJ+Le9CwU=
github.com/0chain/gosdk v1.13.6/go.mod h1:tgAiVAuIy+Vs1tGfKCPEuuWWARwNQBEw32y950LrqrU=
github.com/0chain/gosdk v1.14.0-RC1.0.20240415100519-3195fb50d00e h1:aMMZkBlV4Kcy8ITxAhkCADUxt+BEYM20szqqVkv/7uI=
github.com/0chain/gosdk v1.14.0-RC1.0.20240415100519-3195fb50d00e/go.mod h1:tgAiVAuIy+Vs1tGfKCPEuuWWARwNQBEw32y950LrqrU=
github.com/0chain/gosdk v1.14.0-RC2 h1:OIpjj7mDKxVqJVlxJKm8/fPzdJRN5roXO7/plBCtmTg=
github.com/0chain/gosdk v1.14.0-RC2/go.mod h1:tgAiVAuIy+Vs1tGfKCPEuuWWARwNQBEw32y950LrqrU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw=
Expand Down
4 changes: 3 additions & 1 deletion internal/api/model/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ type ChallengeTiming struct {
}

type SCRestGetAllocationBlobbersResponse struct {
Blobbers *[]string `json:"blobbers"`
Blobbers *[]string `json:"blobbers"`
BlobberAuthTickets []string `json:"blobber_auth_tickets"`
BlobberRequirements
}

Expand Down Expand Up @@ -541,6 +542,7 @@ type UpdateAllocationRequest struct {
Extend bool `json:"extend"`
SetImmutable bool `json:"set_immutable"`
AddBlobberId string `json:"add_blobber_id"`
AddBlobberAuthTicket string `json:"add_blobber_auth_ticket"`
RemoveBlobberId string `json:"remove_blobber_id"`
ThirdPartyExtendable bool `json:"third_party_extendable"`
FileOptionsChanged bool `json:"file_options_changed"`
Expand Down
60 changes: 35 additions & 25 deletions internal/api/model/zbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ type CSRFToken struct {
CSRFToken string `json:"csrf_token"`
}

type ZboxOwner struct {
PhoneNumber string `json:"phone_number"`
UserName string `json:"username"`
}

type ZboxWallet struct {
ClientID string `json:"client_id"`
WalletId int `json:"wallet_id"`
Expand Down Expand Up @@ -61,8 +66,8 @@ type ZboxFreeStorageMarkerResponse struct {
RecipientPublicKey string `json:"recipient_public_key"`
}
type ZboxResourceExist struct {
Exist *bool `json:"exist"`
Error *string `json:"error"`
Exists bool `json:"exists"`
Field string `json:"field"`
}

type ZboxFCMResponse struct {
Expand All @@ -85,6 +90,17 @@ type MessageContainer struct {
Message string `json:"message"`
}

type AllocResponse struct {
ID string `json:"id"`
WalletID int64 `json:"wallet_id"`
Name *string `json:"name"`
Description *string `json:"description"`
AllocationType string `json:"allocation_type"`
BlobbersReplaced int64 `json:"blobbers_replaced"`
AppType string `json:"app_type"`
UpdateAt string `json:"last_update"`
}

type ZboxWalletList struct {
MessageContainer
Data []ZboxWallet `json:"data"`
Expand All @@ -95,10 +111,6 @@ type ZboxAllocationList struct {
Allocs []ZboxAllocation `json:"allocs"`
}

type ZboxWalletArr []struct {
*ZboxWallet
}

type DexState struct {
TxHash string `form:"tx_hash" json:"tx_hash" binding:"-"`
Stage string `form:"stage" json:"stage" binding:"required"`
Expand Down Expand Up @@ -144,14 +156,11 @@ type ZboxGraphChallengesResponse struct {
type ZboxShareInfo struct {
AuthTicket string `json:"auth_ticket"` // FIXME: THIS IS INCONSISTENT WITH THE SPELLING OF "USERNAME"
Message string `json:"message"`
FromInfo string `json:"from_info"`
ClientID string `json:"client_id"`
Receiver string `json:"Receiver"`
Receiver string `json:"receiver_client_id"`
LookUpHash string `json:"lookup_hash"`
CreatedAt string `json:"CreatedAt"`
UpdatedAt string `json:"UpdatedAt"`
AppType int `json:"app_type"`
// [FIXME] need string for app type. Sanchit is working o this.
}

type ZboxShareInfoList struct {
Expand Down Expand Up @@ -189,30 +198,31 @@ type ZboxNftCollectionList struct {
}

type ReferralCodeOfUser struct {
ReferrerCode string `json:"referral_code"`
ReferrerLink string `json:"referral_link"`
ReferrerPhone string `json:"referer_mail"`
ReferrerCode string `json:"referral_code"`
ReferrerLink string `json:"referral_link"`
}

type ReferralCountOfUser struct {
ReferralCount int64 `json:"referral_count"`
RewardPoints int64 `json:"reward_points"`
type ReferralCount struct {
ReferralCount int64 `json:"referral_count"`
RewardPoints int64 `json:"reward_points"`
TotalRewards uint64 `json:"total_rewards"`
}

type TopUser struct {
Score int64 `json:"score"`
Rank int64 `json:"rank"`
type TopReferrer struct {
Referrer string `json:"referrer"`
ReferrerName string `json:"referrer_name"`
Count int `json:"count"`
Avatar []byte `json:"avatar"`
}

type ReferralLeaderBoard struct {
Users []TopUser `json:"users"`
Total int64 `json:"total"`
type TopReferrerResponse struct {
TopUsers []TopReferrer `json:"top_users"`
}

type ReferralRankOfUser struct {
UserRank int64 `json:"rank"`
UserScore int64 `json:"score"`
UserPhone string `json:"phone"`
UserRank int64 `json:"rank"`
UserCount int64 `json:"count"`
ReferrerID int64 `json:"referrer_id"`
}

type ZboxNft struct {
Expand Down
3 changes: 3 additions & 0 deletions internal/api/util/client/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ func (c *APIClient) V1SCRestGetAllocationBlobbers(t *test.SystemTest, scRestGetA
SharderServiceProvider)

scRestGetAllocationBlobbersResponse.Blobbers = blobbers
for range *blobbers {
scRestGetAllocationBlobbersResponse.BlobberAuthTickets = append(scRestGetAllocationBlobbersResponse.BlobberAuthTickets, "")
}
scRestGetAllocationBlobbersResponse.BlobberRequirements = scRestGetAllocationBlobbersRequest.BlobberRequirements

return scRestGetAllocationBlobbersResponse, resp, err
Expand Down
2 changes: 1 addition & 1 deletion internal/api/util/client/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c *BaseHttpClient) executeForServiceProvider(t *test.SystemTest, url strin
case HttpGETMethod:
resp, err = c.HttpClient.R().SetHeaders(executionRequest.Headers).SetQueryParams(executionRequest.QueryParams).Get(url)
case HttpDELETEMethod:
resp, err = c.HttpClient.R().SetHeaders(executionRequest.Headers).SetFormData(executionRequest.FormData).SetBody(executionRequest.Body).Delete(url)
resp, err = c.HttpClient.R().SetHeaders(executionRequest.Headers).SetFormData(executionRequest.FormData).SetQueryParams(executionRequest.QueryParams).SetBody(executionRequest.Body).Delete(url)
}

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/util/client/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (c *SDKClient) AddUploadOperation(t *test.SystemTest, path, format string,
require.NoError(t, err)

remoteName := filepath.Base(path)
remotePath := "/" + filepath.Join("", filepath.Base(path))
remotePath := "/" + filepath.Join(filepath.Dir(path), filepath.Base(path))
if path == "" {
remoteName = filepath.Base(tmpFile.Name())
remotePath = "/" + filepath.Join("", filepath.Base(tmpFile.Name()))
Expand Down

0 comments on commit 55b3bab

Please sign in to comment.