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

Multiple Fixes Following Failed S3 Tests #7270

Merged
merged 4 commits into from
May 31, 2023

Conversation

nadavMiz
Copy link
Contributor

@nadavMiz nadavMiz commented Apr 17, 2023

Explain the Changes

small fixes for s3 tests.
since all the changes are small. the are are in the same pull request but different commits. there are three commits. one for each change:

  1. add condition to check limit for number of deleted objects is larger than 1000 as specified in aws specification - 7b7abb1
  2. changed error returned for invalid encryption algorithm to InvalidArgument - cf2869a
  3. fix test job regex to match against full test names and not substring - 82cd977
  4. add lifecycle rule to pending list status as faulty. s3-tests issue (510) - 4653dac

Issues:

no related issues

Testing Instructions:

run ceph s3 tests using the following instructions:
https://github.com/noobaa/noobaa-core/blob/master/docs/dev_guide/ceph_s3_tests/ceph_s3_tests_guide.md

run the following s3 tests:

  1. s3tests_boto3.functional.test_s3:test_multi_object_delete_key_limit
  2. s3tests_boto3.functional.test_s3:test_lifecycle_set_date
  3. s3tests_boto3.functional.test_s3:test_put_obj_enc_conflict_bad_enc_kms
  • Doc added/updated
  • Tests added

@nadavMiz nadavMiz requested a review from romayalon April 17, 2023 14:21
@nimrod-becker nimrod-becker requested review from a team, tangledbytes and shirady and removed request for a team and tangledbytes April 17, 2023 16:59
@shirady
Copy link
Contributor

shirady commented Apr 18, 2023

Hi @nadavMiz,
Did you notice that test s3tests_boto3.functional.test_s3.test_lifecycle_transition_set_invalid_date is failing in the CI?

src/endpoint/s3/ops/s3_post_bucket_delete.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_post_bucket_delete.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_post_bucket_delete.js Outdated Show resolved Hide resolved
src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
src/endpoint/s3/s3_utils.js Show resolved Hide resolved
@nimrod-becker
Copy link
Contributor

Regarding Q2, since the changed were small I suggested a single PR with 3 commits

@shirady
Copy link
Contributor

shirady commented Apr 18, 2023

Regarding Q2, since the changes were small I suggested a single PR with 3 commits

@nimrod-becker I understood t after the code review.
@nadavMiz, Would you please edit the description of the PR with this explanation?

@nadavMiz
Copy link
Contributor Author

regarding test_lifecycle_transition_set_invalid_date, it looks like it never really passed. it checks if set date returns and exception using prefix and not filter. since we didn't allow to have prefix in the request we sent an error, when fixing this for set date, test_lifecycle_transition_set_invalid_date passed that point and the test failed. I added this test to the pending list

@nadavMiz nadavMiz changed the title multiple fixes following failed s3 tests Multiple Fixes Following Failed S3 Tests Apr 19, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

@baum, would you please also review the changes in this file?

Copy link
Contributor

Choose a reason for hiding this comment

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

Great job on the update! 🖖
It would be beneficial to include a positive test case for the Rule with prefix and a negative test case for the Rule with both prefix and filter. Currently, there is a recipe that involves

  • adding lifecycle configuration instance see here (
    function id_lifecycle_configuration(Bucket, Key) {
    const ID = 'rule_id';
    return {
    Bucket,
    LifecycleConfiguration: {
    Rules: [{
    ID,
    Expiration: {
    Days: 17,
    },
    Filter: {
    Prefix: Key,
    },
    Status: 'Enabled',
    }, ],
    },
    };
    }
    )
  • defining a common test function (
    exports.test_rule_id = async function(Bucket, Key, s3) {
    const putLifecycleParams = id_lifecycle_configuration(Bucket, Key);
    const getLifecycleResult = await put_get_lifecycle_configuration(Bucket, putLifecycleParams, s3);
    const actualId = getLifecycleResult.Rules[0].ID;
    const expectedId = putLifecycleParams.LifecycleConfiguration.Rules[0].ID;
    console.log('get rule id:', actualId, ' expected:', expectedId);
    assert.deepEqual(actualId, expectedId, 'rule id');
    };
    )
  • adding it to the list of unit tests (
    mocha.it('test rule id', async () => {
    await commonTests.test_rule_id(Bucket, Key, s3);
    });
    )
  • and system tests (
    await commonTests.test_rule_id(Bucket, Key, s3);
    ).

It is recommended to run the system lifecycle test manually to compare the lifecycle configuration behavior of AWS S3 and NooBaa endpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@baum I made the tests as requested: lifecycle commit. can you please review them

@shirady
Copy link
Contributor

shirady commented Apr 19, 2023

@nadavMiz in the CI I see it runs 388 passed tests instead of 389 tests (387 we have today + 3 you inserted - 1 you removed is 389 but it is written 388):
Apr-19 14:59:14.653 [test_ceph_s3/25] [INFO] CONSOLE:: CEPH TEST SUMMARY: Suite contains 812, ran 388 tests, Passed: 388, Skipped: 0, Failed: 0
I didn't find the test test_lifecycle_set_date in the logs.
Would you please check this?

@nadavMiz nadavMiz force-pushed the ceph-test-changes branch 2 times, most recently from b33f539 to 41015a8 Compare April 24, 2023 13:18
Copy link
Contributor

@shirady shirady left a comment

Choose a reason for hiding this comment

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

LGTM
Great fixes!
I didn't review the added unit tests @baum asked for.

Copy link
Contributor

@baum baum left a comment

Choose a reason for hiding this comment

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

Thank you, lgtm 🖖

Copy link
Contributor

@liranmauda liranmauda left a comment

Choose a reason for hiding this comment

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

please squash

@shirady
Copy link
Contributor

shirady commented Apr 27, 2023

@liranmauda, those are different fixes and could be in different PRs.
@nimrod-becker asked for one PR with a couple of commits as I understand.

@nimrod-becker
Copy link
Contributor

Ack on Shira's comment. 3 different fixes

@shirady
Copy link
Contributor

shirady commented Apr 27, 2023

Ack on Shira's comment. 3 different fixes

I'll add that the 4th commit is a fix for an issue we found during this PR in the script running all tests (not a specific test).

src/endpoint/s3/ops/s3_put_bucket_lifecycle.js Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/M and removed size/L labels Apr 27, 2023
@liranmauda liranmauda dismissed their stale review May 31, 2023 12:38

should net be blocked....

@nadavMiz nadavMiz merged commit ecf338a into noobaa:master May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants