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

Workflow to run S3 tests. Fixes #782 #809

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Conversation

MaxGelbakhiani
Copy link
Contributor

@MaxGelbakhiani MaxGelbakhiani commented Aug 15, 2023

Merge after
nspcc-dev/s3-tests#34
nspcc-dev/s3-tests#33

  • Workflow runs 250 sanity tests on PR and full test suite on any other event.
  • Sanity run takes less than 30 minutes.
  • For now, for Sanity I picked a set of tests, that are always green during my test runs
  • Full test suite runs around 5 hours.

After merging we'll need to add action secrets:
secrets.TEST_RESULTS_WALLET
secrets.TEST_RESULTS_PASSWORD
And action variables:
vars.TEST_RESULTS_NEOFS_NETWORK_DOMAIN
vars.TEST_RESULTS_CID
vars.TEST_RESULTS_HTTP_GATE

SSL is going to be fixed on later stages

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #809 (e03a17b) into master (d013f71) will decrease coverage by 0.30%.
Report is 33 commits behind head on master.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #809      +/-   ##
==========================================
- Coverage   34.35%   34.05%   -0.30%     
==========================================
  Files          61       61              
  Lines       10483    10472      -11     
==========================================
- Hits         3601     3566      -35     
- Misses       6481     6505      +24     
  Partials      401      401              

see 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more


- name: Build neofs-s3-gw docker image
run: |
cp .github/test-env .env #looks ugly, but I want to try
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does make require an .env file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, it doesn't

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right, it doesn't

If not needed, then why cp .github/test-env .env ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now, I removed it


- name: Prepare s3tests config
run: |
sed -i -e "s/host =.*$/host = ${S3_GW_IP}/" ${S3_TESTS_CONFIG}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dangerous regular expression - maybe there's more than one string that matches the host =.* pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default, sed uses only single-line matching. To enable multiline matching you need to enable it with 'N' command, like this:
sed 'N; s/.* MULTILINE TEXT.*//' test.file

So, greedy regex is pretty safe here.

But, ok. I switched to a non-greedy '.*?' pattern

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is best to replace lines like this with:
sed -i -E "s/host =.*?$/host = ${S3_GW_IP}/" ${S3_TESTS_CONFIG}
with the following:
sed -i -E "s/host =__HOSTS_TO_CHANGE__/host = ${S3_GW_IP}/" ${S3_TESTS_CONFIG}
Of course, this will require changes to the config file too.
That way you can be sure that some other line that someone else put in the config file won't change.
It will also make it easier for other users to interact with the config file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Go rid of this sed substitution with suitable employment of .env file for s3-dev-env.

Copy link
Collaborator

@vvarg229 vvarg229 left a comment

Choose a reason for hiding this comment

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

It might be a good idea to fix regular expressions

Signed-off-by: Maksim Gelbakhiani <max@nspcc.io>
vvarg229
vvarg229 previously approved these changes Sep 11, 2023
@roman-khimov
Copy link
Member

I've just noticed that we're completely missing expirations here, they should be added

Signed-off-by: Maksim Gelbakhiani <max@nspcc.io>
@roman-khimov roman-khimov merged commit 58c5c9c into master Sep 18, 2023
@roman-khimov roman-khimov deleted the s3-tests-workflow branch September 18, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants