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

Fix scrape service test #44

Merged
merged 1 commit into from
Jun 2, 2022
Merged

Conversation

penmanglewood
Copy link
Contributor

@penmanglewood penmanglewood commented Jun 2, 2022

#43 changed the function signature for newPagespeedScrapeService, but the test file was not updated.

This PR fixes that syntax error and additionally it allows the non-short version of the test to authenticate against the Pagespeed API to run the full test.

The tests can be run as follows:

# run all tests, skipping the scrape service test
go test -short ./... 

# runs all tests, but skips the scrape service test because the api key
# and credentials file envvars are not set
go test ./...

# runs all tests, including the scrape service integration test, calling the real Pagespeed API
export PAGESPEED_API_KEY=yourapikey
go test ./...

# same as above
export PAGESPEED_CREDENTIALS_FILE=/path/to/credentials.json
go test ./...

This fixes the test in two ways. It fixes the syntax of
newPagespeedScrapeService having two return values, and
it allows authentication against Google to actually call
the Pagespeed API for the non-short version of the test.
@smartinov smartinov merged commit 539158c into foomo:master Jun 2, 2022
@penmanglewood penmanglewood deleted the fix-scrape-service-test branch June 2, 2022 10:03
@penmanglewood
Copy link
Contributor Author

Thank you @smartinov and sorry for the trouble 🙏

@smartinov
Copy link
Contributor

@penmanglewood no trouble at all! Thank you for the contribution!

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.

2 participants