147 Commits

Author SHA1 Message Date
Eric
fb48ef889b
formatting
trying to make nph happy
2025-11-04 20:02:28 +11:00
Eric
86cce5b3a4
formatting 2025-11-04 20:02:28 +11:00
Eric
30d30080a8
clean up 2025-11-04 20:02:28 +11:00
Eric
ace3644f2d
use tracked futures for showContinuousStatusUpdates 2025-11-04 20:02:28 +11:00
Eric
0e9b42fa39
formatting 2025-11-04 20:02:28 +11:00
Eric
6ccd84b94f
fix rebase, formatting 2025-11-04 20:02:27 +11:00
Eric
f9c52ccc63
fix rebase 2025-11-04 20:02:27 +11:00
Eric
8f43789269
Use absolute path for binary when checking for existence 2025-11-04 20:02:26 +11:00
Eric
53614572e6
fail early with message when hardhat binary not found
# Conflicts:
#	tests/integration/hardhatprocess.nim
2025-11-04 20:02:26 +11:00
Eric
cb0b3023c8
remove unneeded sleep 2025-11-04 20:02:26 +11:00
Eric
b4e3e2cfc1
make onoutputline callback gcsafe 2025-11-04 20:02:26 +11:00
Eric
63e4236ee0
increase port distance per test run 2025-11-04 20:02:26 +11:00
Eric
37d5443be6
add constructor param for continuous status update in terminal
# Conflicts:
#	tests/testIntegration.nim
2025-11-04 20:02:26 +11:00
Eric
7d3a34db2e
fix nodeprocess not exiting 2025-11-04 20:02:26 +11:00
Eric
431cd524c2
ensure timeouts work
Work around the AsyncProcess timeout not working correctly
2025-11-04 20:02:25 +11:00
Eric
69ad29a9b8
continually show test status updates
allows user to know which tests are still running
2025-11-04 20:02:25 +11:00
Eric
aeb651fcb7
cleanup
# Conflicts:
#	tests/testIntegration.nim
2025-11-04 20:02:25 +11:00
Eric
4b3dc2bf83
lock hardhat start to avoid intermittent start failures 2025-11-04 20:02:25 +11:00
Eric
92ee0cb81c
clean up 2025-11-04 20:02:25 +11:00
Eric
110764f7f4
print hardhat testmanager errors and hardhat stdout when there is an error starting hardhat 2025-11-04 20:02:25 +11:00
Eric
3ede65f661
hang manager off IntegrationTest, cleanup
- add a TestManager property to IntegrationTest, so manager does not need to be passed into all functions
- cleanup:
  - remove unneeded stopHardhat function
  - add hardhat instance to manager outside of startHardhat
2025-11-04 20:02:24 +11:00
Eric
8904044fc2
reinstate removed types 2025-11-04 20:02:24 +11:00
Eric
f493b4c197
Add additional logging info print outs
# Conflicts:
#	tests/integration/testcli.nim
2025-11-04 20:02:24 +11:00
Eric
8f8d00bd04
expect process exit code
prevents showing error in the logs when an expected process exit code is encountered

# Conflicts:
#	tests/integration/testcli.nim
2025-11-04 20:02:24 +11:00
Eric
6c577f3461
stop hardhat and show logs
# Conflicts:
#	tests/integration/hardhatprocess.nim
2025-11-04 20:02:24 +11:00
Eric
a2e74dc4a1
default test name to the filename of the integration test
# Conflicts:
#	tests/testIntegration.nim
2025-11-04 20:02:23 +11:00
Eric
887d6e9962
print start/finish stderr/stdout markers
# Conflicts:
#	tests/testIntegration.nim
2025-11-04 20:02:23 +11:00
Eric
525aa59fe1
clean up 2025-11-04 20:02:23 +11:00
Eric
321921894d
stdout formatting for test results
# Conflicts:
#	tests/testIntegration.nim
2025-11-04 20:02:23 +11:00
Eric
eb06b6c0c6
prevent errors during node shutdown 2025-11-04 20:02:23 +11:00
Eric
34d4f781c3
test summary formatting 2025-11-04 20:02:23 +11:00
Eric
9ef61aedc4
parallel tests running
- need to test with longer tests to ensure the parallelisation is truly happening
- is the +10 hardhat port needed?
- try with more integration tests

# Conflicts:
#	tests/integration/hardhatprocess.nim
#	tests/integration/multinodes.nim
#	tests/integration/testcli.nim
#	tests/testIntegration.nim
2025-11-04 20:02:22 +11:00
Arnaud
db8f866db4
feat: check if CID exists in local store (#1331) 2025-11-02 04:32:47 +00:00
Eric
072bff5cab
fix: ci integration tests (#1335) 2025-10-30 19:38:11 +11:00
markspanbroek
01615354af
refactor(ci): run integration tests in parallel by spinning up more runners (#1287) 2025-06-25 08:56:16 +00:00
Arnaud
7b660e3554
chore(marketplace): use hardhat ignition (#1195) 2025-06-20 15:55:00 +00:00
Arnaud
d443df441d
chore: improve marketplace integration tests (#1268) 2025-06-19 06:36:10 +00:00
Chrysostomos Nanakos
b305e00160
Add support for slot reconstruction on unavailable slot detection (#1235)
Co-authored-by: Arnaud <arnaud@status.im>
2025-06-12 22:19:42 +00:00
Arnaud
ca869f6dce
fix(availabilities): use totalRemainingCollateral instead of totalCollateral for comparaison (#1229)
* Use totalRemainingCollateral instead of totalCollateral to compare the availability changes

* Update test to use totalRemainingCollateral instead of totalCollateral when testing OnAvailabilitySaved

* Reduce poll interval

* Fix flaky test

* Fix format
2025-06-02 16:47:12 +00:00
Arnaud
28a83db69e
chore: returns the collateral when a slot is reserved but not filled (#1216)
* Change token allowance method because increaseAllowance does not exist anymore

* Returns collateral when a reservation is deleted and not only a slot is filled

* Remove the returnedCollateral when the slot is not filled by the host

* Add returnedCollateral when the sale is ignored

* Add returnsCollateral variable for ignored state

* Rebase the contracts submodule on the master

* Add integration test

* Fix duration

* Remove unnecessary teardown function

* Remove misleading comment

* Get returned collateral from the request

* Enable logs to debug on CI

* Fix test

* Increase test timeout

* Fix typo

* Fix rebase
2025-05-29 14:47:37 +00:00
Arnaud
c689542579
fix: sales cleanup cancellation (#1234)
* fix(sales): handle cancellation of slot cleanup

Ensures that processing slots from the slot queue
continues even when cleanup of a slot is cancelled.

Co-Authored-By: Eric <5089238+emizzle@users.noreply.github.com>

* chore(reservations): add more `raises` annotations

* Fix cleanup cancellation

* Add remove-agent to trackedfutures instead of the cleanup function

* Increase the timeout to match the request expiry

* Enable logs to debug on CI

* Remove useless except and do not return when add item back to slot queue fails

* Reduce poll interval to detect sale cancelled state

* Avoid cancelling cleanup routine

* Do not cancel creating reservation in order to avoid inconsistent state

* Remove useless try except

---------

Co-authored-by: Mark Spanbroek <mark@spanbroek.net>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2025-05-29 06:57:05 +00:00
markspanbroek
25a8077e80
fix(integration): fix api validation test (#1201)
* integration: shutdown codex node at end of test

On Windows the codex node did not shut down properly after this test
finished.

* contracts: fix flaky test
2025-05-26 16:49:53 +00:00
Arnaud
f7d06cd0e8
chore(marketplace): switch to websocket (#1166)
* Switch to websocket

* Create resubscribe future

* Resubscribe websocket events after 5 minutes

* Remove the subscribe workaround and use define the resubscribe symbol

* Use localhost for ws url

* Define 240 seconds for resubscription interval

* Ensute that updates are sync when using ws
2025-05-23 14:13:19 +00:00
Adam Uhlíř
f144099377
fix(api): availability creation validation (#1212) 2025-05-14 08:46:16 +00:00
Arnaud
7deeb7d2b3
feat(marketplace): persistent availabilities (#1099)
* Add availability enabled parameter

* Return bytes to availability when finished

* Add until parameter

* Remove debug message

* Clean up and fix tests

* Update documentations and cleanup

* Avoid swallowing CancelledError

* Move until validation to reservations module

* Call onAvailabilityAdded callabck when the availability is enabled in sales

* Remove until validation in restapi when creating an availability

* Add openapi documentation

* Use results instead of stew/results (#1112)

* feat: request duration limit (#1057)

* feat: request duration limit

* Fix tests and duration type

* Add custom error

* Remove merge issue

* Update codex contracts eth

* Update market config and fix test

* Fix SlotReservationsConfig syntax

* Update dependencies

* test: remove doubled test

* chore: update contracts repo

---------

Co-authored-by: Arnaud <arnaud@status.im>

* fix(statemachine): do not raise from state.run (#1115)

* fix(statemachine): do not raise from state.run

* fix rebase

* fix exception handling in SaleProvingSimulated.prove

- re-raise CancelledError
- don't return State on CatchableError
- expect the Proofs_InvalidProof custom error instead of checking a string

* asyncSpawn salesagent.onCancelled

This was swallowing a KeyError in one of the tests (fixed in the previous commit)

* remove error handling states in asyncstatemachine

* revert unneeded changes

* formatting

* PR feedback, logging updates

* chore(integration): simplify block expiration integration test (#1100)

* chore(integration): simplify block expiration integration test

* clean up

* fix after rebase

* perf: contract storage optimizations (#1094)

* perf: contract storage optimizations

* Apply optimization changes

* Apply optimizing parameters sizing

* Update codex-contracts-eth

* bump latest changes in contracts branch

* Change requestDurationLimit to uint64

* fix tests

* fix tests

---------

Co-authored-by: Arnaud <arnaud@status.im>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>

* bump contracts to master (#1122)

* Add availability enabled parameter

* Return bytes to availability when finished

* Add until parameter

* Clean up and fix tests

* Move until validation to reservations module

* Apply suggestion changes: return the reservation module error

* Apply suggestion changes for until dates

* Apply suggestion changes: reorganize tests

* Fix indent

* Remove test related to timing issue

* Add raises errors to async pragram and remove useless try except

* Update open api documentation

* Fix wording

* Remove the httpClient restart statements

* Use market.getRequestEnd to set validUntil

* Remove returnBytes

* Use clock.now in testing

* Move the api validation file to the right file

---------

Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2025-03-26 11:45:22 +00:00
Arnaud
a0d6fbaf02
chore(marketplace) - fix the http error codes when validating the availability requests (#1104)
* Use 422 http code when there is a validation error

* Update the open api description

* Fix typo

* Add more tests for total size

* Catch CancelledError because TrackedFuture raise no error

* Split rest api validation test to a new file

* Change the way of testing negative numbers

* Rename client variable and fix test status code

* Try to reduce the number of requests in CI when asserting in tests

* Fix rebase and remove safeEventually
2025-03-24 15:47:05 +00:00
Arnaud
709a8648fd
chore: add request validations (#1144)
* Add request validations

* Define expiry as required field in storage request params and fix tests

* Fix error messages

* Enable logs to figure out the issue with recurring failing test on macos

* Add custom errors raised by contract

* Remove custom error non existing anymore

* Update asynctest module

* Update timer tests after updating asynctest
2025-03-24 11:53:34 +00:00
Giuliano Mega
54177e9fbf
feat(integration): use async client instead of standard Nim HTTP client (#1159)
* WiP: migrating CodexClient to chronos http client

* fix(api): fixes #1163

* feat: fully working API integration tests

* convert most of the tests in testupdownload

* feat: working updownload tests on async client

* feat: make testsales work with async codexclient

* feat: make testpurchasing work with async codexclient

* feat: make testblockexpiration work with async codexclient

* feat: make marketplacesuite work with async codexclient

* make testproofs work with async codexclient

* chore: refactor client to express higher level in terms of lower level operations

* fix: set correct content-length for erasure-coded datasets

* feat: make testecbug work with async client

* feat: make testvalidator work with async client

* refactor: simplify request aliases, add close operation

* wire back client.close at node shutdown

* refactor: remove unused exception

* fix: use await instead of waitFor on async call sites
2025-03-17 20:08:24 +00:00
Arnaud
2538ff8da3
chore: create new httpClient per request (#1136)
* Create new httpClient per request

* Fix tests after rebase and close the clients at the end
2025-03-12 13:41:00 +00:00
Arnaud
703921df32
chore(restapi): add headers to support on progress when downloading (#1150)
* Add headers to support on progress on download

* Replace http session by http client in downloadBytes

* Use int instead of int64 for datasetSize

* Rename variable to avoid shallowing client
2025-03-10 15:59:24 +00:00