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

Test for unification of path filtering across POSIX and Windows #1303

Merged
merged 14 commits into from
Oct 3, 2022
Merged

Test for unification of path filtering across POSIX and Windows #1303

merged 14 commits into from
Oct 3, 2022

Conversation

pcaversaccio
Copy link
Contributor

@pcaversaccio pcaversaccio commented Jul 26, 2022

As discussed with @0xalpharush in #1196 I now wrote a small test suite that checks if path filtering across POSIX and Windows works.

The CI tests will fail with the error "Path filtering across POSIX and Windows failed" because you use the master branch in the CI to set up Slither. So this is a good error :-D. I tested it here.

The strategy I took here is that I made a couple of contracts that contain reentrancy issues as dependencies to a main (empty) contract. Now if you filter out the paths properly, the output should be zero result(s) found.

I hope the code is in line with your internal rules (not sure about the solc version for the test contracts).

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@CLAassistant
Copy link

CLAassistant commented Jul 26, 2022

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio
Copy link
Contributor Author

@montyly I just saw you re-triggered the actions. Is there something wrong with the code?

As mentioned above, the reason why it's failing (and it's actually good) is because of how you set up the CI flow.

You use python setup.py install and in the setup.py you use Slither version 0.8.3 which does not contain the fix from #1196.

@montyly
Copy link
Member

montyly commented Jul 27, 2022

@pcaversaccio: my bad; there were some timeout issues in the CI due to too many urls requests, so I just went ahead an re-run the recent PRs with failing actions to see if they were affected :)

@pcaversaccio
Copy link
Contributor Author

@montyly lol - had a similar problem recently.

@pcaversaccio
Copy link
Contributor Author

@0xalpharush @montyly any feedback on this PR? IMHO it's ready to be merged.

@pcaversaccio
Copy link
Contributor Author

hey guys, @0xalpharush @montyly - it's been already some time since I prepared that PR. Would appreciate some feedback or let's get it merged if you agree, thx!

@elopez
Copy link
Member

elopez commented Sep 25, 2022

Thanks for the PR @pcaversaccio & apologies for the delayed review! I've left some comments inline, but overall this looks ok. The only thing that needs to be addressed is the change due to the introduction of the new --fail-* options in slither. If you could merge dev into your branch to get the new code in and address the comments in the PR that'd be awesome!

Merge `dev` into `patch-1`
@pcaversaccio
Copy link
Contributor Author

@elopez thanks for the feedback - dev is merged into my branch via https://github.com/pcaversaccio/slither/pull/1. I searched for your inline comments but couldn't find anything - could you please point me to your feedback, thx.

Copy link
Member

@elopez elopez left a comment

Choose a reason for hiding this comment

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

For some reason GitHub didn't submit them together with my comment earlier, my apologies. You should see them now.

tests/test_path_filtering/slither.config.json Outdated Show resolved Hide resolved
scripts/ci_test_path_filtering.sh Outdated Show resolved Hide resolved
scripts/ci_test_path_filtering.sh Show resolved Hide resolved
pcaversaccio and others added 2 commits September 26, 2022 15:02
Co-authored-by: Emilio López <2642849+elopez@users.noreply.github.com>
Co-authored-by: Emilio López <2642849+elopez@users.noreply.github.com>
@elopez
Copy link
Member

elopez commented Sep 26, 2022

It looks like the CI test fails @pcaversaccio 🤔 could you take a look? I suspect it might need solc-select install & use 0.8.0 in the script (the pipeline runs with a 0.5.x version otherwise)

@pcaversaccio
Copy link
Contributor Author

pcaversaccio commented Sep 26, 2022

@elopez I already indicated here why the tests are failing. Since we test against Slither version 0.8.3 which does not contain your fix the test is failing (which is actually good since it does its job). Don't know how to resolve this tbh.

image

@elopez
Copy link
Member

elopez commented Sep 26, 2022

@pcaversaccio the tests install slither from dev (or whatever the PR branch is built off of) source code, which already has the changes in #1196 merged in, so the tests should be passing. The version number is not relevant for this, as the release is not pulled from PyPI. I think it's just a matter of the test solidity code failing to build, as the CI pipeline uses solc 0.5.x and the code requires 0.8.x

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio
Copy link
Contributor Author

@elopez you are completely right! I pushed a fix - could re-trigger the actions?

@pcaversaccio
Copy link
Contributor Author

yeah :-D everything green. thx for the hint!

@montyly
Copy link
Member

montyly commented Oct 3, 2022

This is great, thanks @pcaversaccio

@montyly montyly merged commit 7313806 into crytic:dev Oct 3, 2022
@pcaversaccio pcaversaccio deleted the patch-1 branch October 3, 2022 09:59
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.

None yet

4 participants