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

feat(cli): Added url hash to differentiate between urls #835

Conversation

jaspritt-hora
Copy link
Contributor

@jaspritt-hora jaspritt-hora commented Oct 22, 2022

ADDED:

  • hash parameter, while generating reports for apps using #/
  • Test case added for the same

NOTE:

@google-cla
Copy link

google-cla bot commented Oct 22, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jaspritt-hora jaspritt-hora force-pushed the adding-url-hash-report-generation branch from 6c0677f to 8f4e505 Compare October 22, 2022 17:55
@jaspritt-hora
Copy link
Contributor Author

jaspritt-hora commented Oct 22, 2022

@patrickhulce - Changes are done. Please review and let me know, if anything is required.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

thanks @jaspritt-hora!

could you add a test case here?

@@ -542,7 +542,7 @@ async function runFilesystemTarget(options) {
const fetchTimeDate = new Date(new Date(lhr.fetchTime).getTime() || Date.now());
const context = {
hostname: url.hostname,
pathname: url.pathname,
pathname: url.hash + url.pathname,
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't want to merge these two, we would want them to be separate

Suggested change
pathname: url.hash + url.pathname,
pathname: url.pathname,
hash: url.hash,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patrickhulce - Regarding the test case, we want to add the test case for both collect & upload or just the latter?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Collect isn't being touched here, just upload

Copy link
Contributor Author

@jaspritt-hora jaspritt-hora Oct 25, 2022

Choose a reason for hiding this comment

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

@patrickhulce - Sounds good! I have made the suggested change and written the test case in a new file and it is working as expected.

However, I have a question, NOT all the test cases are running on my machine.
Refer following screenshot -

The unit test case file, I have written is - upload-url-hash.test.js. The test for this has passed.
image

However, NOT ALL the test suites are passing. Refer following screenshot -
image

Can I go ahead and commit the changes ?
OR
Do I need the entire test suite to pass?

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't worry about the whole test suite for now, some are flaky and/or require other setup on your machine like mysql, if upload tests are passing you should be a-ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect!

Copy link
Contributor Author

@jaspritt-hora jaspritt-hora Oct 26, 2022

Choose a reason for hiding this comment

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

@patrickhulce - Please run all the checks again. The issue was related to syncing of directories, I have added rimraf and the required code for the same. The test case is running successfully now, had 3 consecutive successful runs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patrickhulce - Checked the raw logs for both windows and macOS checks that have failed, in that - the test case written for the PR has passed successfully.

The test case file name is - upload-url-hash.test.js.
Let me know, if there anything actionable at my end.

@jaspritt-hora jaspritt-hora force-pushed the adding-url-hash-report-generation branch from 8086a00 to fc8f7cf Compare October 26, 2022 18:44
@@ -0,0 +1,113 @@
/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @license Copyright 2019 Google Inc. All Rights Reserved.
* @license Copyright 2022 Google Inc. All Rights Reserved.

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