Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for DA job #61

Closed
wants to merge 23 commits into from
Closed

Conversation

heemankv
Copy link
Contributor

@heemankv heemankv commented Jul 26, 2024

This PR introduces tests for DA Job.

Pre-Requisites :

  1. MongoDB docker up and running.
  2. LocalStack docker up and running.

Integration Tests :

(No tests needed for create_job and verify_job)

  1. test_da_job_process_job_failure_on_impossible_blob_length
  2. test_da_job_process_job_failure_on_pending_block
  3. test_da_job_process_job_success

Unit Tests :

  1. test_da_word
  2. test_state_update_to_blob_data
  3. test_fft_transformation
  4. test_bincode

Build_Config :

Link to File

  • Added S3 initiation in init storage section.
  • Reworked from madara_rpc_url to localhost:{server.port} since ServerMock doesn't work with predefined url.

@heemankv heemankv self-assigned this Jul 26, 2024
@heemankv heemankv changed the base branch from main to feat/increasing-test-coverage July 29, 2024 07:07
@heemankv heemankv added the enhancement New feature or request label Jul 29, 2024
.env.example Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
heemankv and others added 5 commits July 30, 2024 21:03
Co-authored-by: Apoorv Sadana <95699312+apoorvsadana@users.noreply.github.com>
Co-authored-by: Apoorv Sadana <95699312+apoorvsadana@users.noreply.github.com>
* update: added thiserror JobError

* update: introducing DaError

* update: add ProverJobError

* update: Register proof JobError

* update: SNOS proof JobError

* update: JobError on Queue

* update: added fix for borrow in state update process job

* update: cleaning rework for JobError

* updaet: wrap_err_with -> wrap_err wherever used with String

* update: moved all JobErrors to top of file

* update: Errors for comsume_job_from_queue

* update: linting fixes

* update: optimised consume_job_from_queue match statement

* update: code optimisation based on PR reviews
Base automatically changed from feat/increasing-test-coverage to main August 7, 2024 14:48
crates/orchestrator/src/tests/common/mod.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/data_storage/mod.rs Outdated Show resolved Hide resolved
#[rstest]
#[tokio::test]
async fn test_put_and_get_data_s3() -> color_eyre::Result<()> {
TestConfigBuilder::new().build().await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be moved into a fixture

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestConfigBuilder allows for customisation over any external client of our choice,
moving it to a global fixture is not feasible since all test cases have different customisation requirements.

We can make fixture for tests under same scope if they require same customised external clients.

for eg :
All tests under da_job if require same config customisation, can implement a fixture just for themselves.
similarly for other scopes .

We can create a separate issue for this and resolve there.

IMPORTANT

[This branch is a fork from increasing coverage ]
[This comment refers to changed already merged to main, they are shown here since #52 is merged and the base of this PR automatically shifted to main ]

crates/orchestrator/src/tests/database/mod.rs Outdated Show resolved Hide resolved
crates/settlement-clients/ethereum/src/lib.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/tests/jobs/da_job/mod.rs Outdated Show resolved Hide resolved
@apoorvsadana apoorvsadana changed the base branch from main to feat/increasing-test-coverage August 8, 2024 09:14
@apoorvsadana
Copy link
Contributor

Closing in favor of #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants