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

added integration tests for sources #80

Merged
merged 19 commits into from
Oct 6, 2022
Merged

added integration tests for sources #80

merged 19 commits into from
Oct 6, 2022

Conversation

LuitelSamikshya
Copy link
Contributor

@LuitelSamikshya LuitelSamikshya commented Sep 30, 2022

closes #72
Added integration tests on providers that runs once a week.

@LuitelSamikshya LuitelSamikshya marked this pull request as draft September 30, 2022 17:38
@LuitelSamikshya LuitelSamikshya self-assigned this Sep 30, 2022
@LuitelSamikshya LuitelSamikshya linked an issue Sep 30, 2022 that may be closed by this pull request
5 tasks
@LuitelSamikshya LuitelSamikshya added the Type: Enhancement Most issues will probably ask for additions or changes. label Sep 30, 2022
@LuitelSamikshya LuitelSamikshya marked this pull request as ready for review October 3, 2022 15:03
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

Please replace all occurrences of ioutil.WriteFile with os.WriteFile

integration-tests/source-test.go Outdated Show resolved Hide resolved
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

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

@LuitelSamikshya I can confirm test is being passed regardless of result, for example dummy key is used for ZOOMEYE_API_KEY and I can see [✓] Test "zoomeye" passed!.

export ZOOMEYE_API_KEY=this_is_test
$ bash run.sh
::task~> Clean up & Build binaries files
::done::
::task~> Run integration test
Running test cases for "censys" source
[✘] Test "censys" failed: missing censys api key
Running test cases for "shodan" source
[✘] Test "shodan" failed: missing shodan api key
Running test cases for "zoomeye" source
[bash -c ./uncover -zoomeye 'app:"Atlassian JIRA"']
/bin/bash -c ./uncover -zoomeye 'app:"Atlassian JIRA"' -v

  __  ______  _________ _   _____  _____
 / / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ /  __/ /    
\__,_/_/ /_/\___/\____/|___/\___/_/ v0.0.8

		projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using uncover, you also agree to the terms of the APIs used.


[✓] Test "zoomeye" passed!
Running test cases for "fofa" source
[✘] Test "fofa" failed: missing fofa api key
Running test cases for "quake" source
[✘] Test "quake" failed: missing quake api key
::done::

@LuitelSamikshya
Copy link
Contributor Author

@LuitelSamikshya I can confirm test is being passed regardless of result, for example dummy key is used for ZOOMEYE_API_KEY and I can see [✓] Test "zoomeye" passed!.

export ZOOMEYE_API_KEY=this_is_test
$ bash run.sh
::task~> Clean up & Build binaries files
::done::
::task~> Run integration test
Running test cases for "censys" source
[✘] Test "censys" failed: missing censys api key
Running test cases for "shodan" source
[✘] Test "shodan" failed: missing shodan api key
Running test cases for "zoomeye" source
[bash -c ./uncover -zoomeye 'app:"Atlassian JIRA"']
/bin/bash -c ./uncover -zoomeye 'app:"Atlassian JIRA"' -v

  __  ______  _________ _   _____  _____
 / / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ /  __/ /    
\__,_/_/ /_/\___/\____/|___/\___/_/ v0.0.8

		projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using uncover, you also agree to the terms of the APIs used.


[✓] Test "zoomeye" passed!
Running test cases for "fofa" source
[✘] Test "fofa" failed: missing fofa api key
Running test cases for "quake" source
[✘] Test "quake" failed: missing quake api key
::done::

The test should pass only with the use of actual key now. Some of the providers endpoint are throwing 429 error, therefore added a cron job to run tests on providers once a week.

@ehsandeep ehsandeep merged commit 4c53686 into dev Oct 6, 2022
@ehsandeep ehsandeep deleted the add-integration-tests branch October 6, 2022 09:57
gy741 pushed a commit to gy741/uncover that referenced this pull request Dec 12, 2022
* added integration tests for sources

* added censys api secret

* yaml format fix

* file name change

* api key

* trial

* added fofa key

* added default config file

* used config file

* lint error fix and added more secrets

* misc changes

* different query for zoomeye

* removed reference of deprecated library

* misc change

* added additinal workflow

* deleted repeating stage

* cron job every Monday at 12

* added manual run option for workflow

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integration test for supported providers
3 participants