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

Enable nvda / firefox browser combination for automated testing #950

Merged
merged 2 commits into from Mar 18, 2024

Conversation

gnarf
Copy link
Contributor

@gnarf gnarf commented Mar 7, 2024

Tested locally seems fine!

Copy link
Contributor

@howard-e howard-e left a comment

Choose a reason for hiding this comment

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

Looks good! Did a test locally (to ensure the chrome build hasn't changed)

Tiny nitpick - I haven't reviewed this file closely before but there's a typo on L42: 'Envrionment ... if you'd also like to include that here

@@ -126,13 +126,15 @@ const createGithubWorkflow = async ({ job, directory, gitSha }) => {
jsonWebToken,
GITHUB_APP_INSTALLATION_ID
);
const browser = job.testPlanRun.testPlanReport.browser.name.toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

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

There are keys provided for the browsers but it's not currently passed from the database or available in the resolvers.

It's definitely not a problem here but wanted to raise that, in case it may lighten and simplify the load on this service trying to derive a key from "VoiceOver for macOS".toLowerCase() for example, in the future. It would also maintain predictable key maps for the browsers across this app and the workflow(s) being triggered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would probably make more sense if this key you speak of if it is closer to being just "chrome" "firefox" "edge" etc. Browser currently seems to be defined:

    const Model = sequelize.define(
        MODEL_NAME,
        {
            id: {
                type: DataTypes.INTEGER,
                allowNull: false,
                primaryKey: true,
                autoIncrement: true
            },
            name: {
                type: DataTypes.TEXT,
                allowNull: false
            }
        },
        {
            timestamps: false,
            tableName: MODEL_NAME
        }
    );

Am I missing something here? It seems like browser is just id/name (and the name to lower also seem pretty safe in this case)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oop! I realize now that I gave a bad and very confusing example because I must have viewed the AT table at the time I made the comment.

There are keys provided for the browsers but it's not currently passed from the database or available in the resolvers.

I was wrong on this. Still in my confusion, I was referencing ATs BUT those keys also aren't being tracked in the db, instead being derived. This comment is then irrelevant to this PR.

It seems like browser is just id/name (and the name to lower also seem pretty safe in this case)

It is safe!

But the point I'm making could still stand, in that there should be stored keys somehow. Not something for this PR but I think I'm just now becoming aware of a potential data consistency issue.

In the examples you gave here, when "Edge" gets added, they may want to present it as "Microsoft Edge" but the service (or other sections of the app) could want to resolve "Microsoft Edge" to "edge" for simplicity. Or if it ever comes to adding "Safari (for iOS)" -> "safari_ios", it would mean renaming the current "Safari" browser being tracked to something more appropriate like "Safari (for macOS)" which could have been implicitly being thought of as "safari_macos" anyways.

All that to say, I'd feel safer using:

job.testPlanRun.testPlanReport.browser.key;

VS

job.testPlanRun.testPlanReport.browser.name.toLowerCase();

OR

getBrowserKey(job.testPlanRun.testPlanReport.browser.name.toLowerCase());

If you or others agree to those keys, then that's a separate task to maybe make future needs easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

^ i don't feel entirely qualified to make this patch, the database stuff is still a bit of a mystery to me, but i do think that a "key" that isn't the "display name" here is probably the long-term "right" solution. (Followup issue?) I don't think we need to solve it to land this however.

Copy link
Contributor

@howard-e howard-e Mar 11, 2024

Choose a reason for hiding this comment

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

(Followup issue?) I don't think we need to solve it to land this however.

Agreed! I can make a follow up issue to discuss

Copy link
Contributor

Choose a reason for hiding this comment

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

Just adding a +1 to what @howard-e is suggesting!

Copy link
Contributor

Choose a reason for hiding this comment

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

@gnarf gnarf mentioned this pull request Mar 11, 2024
@gnarf
Copy link
Contributor Author

gnarf commented Mar 11, 2024

Tiny nitpick - I haven't reviewed this file closely before but there's a typo on L42: 'Envrionment ... if you'd also like to include that here

#954

@gnarf gnarf requested a review from stalgiag March 11, 2024 18:29
Copy link
Contributor

@stalgiag stalgiag left a comment

Choose a reason for hiding this comment

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

Thanks for starting this. What is here looks good but there are a few related things that need updating at the same time.

The code that is responsible for making a new browser version if the response collector reports a browser version that doesn't exist already always assumes Chrome.

The local simulated automation scheduler also assumes Chrome when it selects the relevant test plan report from a test plan version.

@gnarf
Copy link
Contributor Author

gnarf commented Mar 11, 2024

Thanks for starting this. What is here looks good but there are a few related things that need updating at the same time.

thanks! glad you had the time to provide this input before it was forgotten! I'll get right on these changes!

Copy link
Contributor

@alflennik alflennik left a comment

Choose a reason for hiding this comment

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

I looked over all the code, but mainly I focused on the transaction changes, which look to be really solid enhancements. I think we should merge this PR before #951 because I do expect some conflicts and I don't want them to block this PR.

@gnarf gnarf dismissed stalgiag’s stale review March 18, 2024 18:11

We added the requested changes together

Copy link
Contributor

@howard-e howard-e left a comment

Choose a reason for hiding this comment

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

Looks good to me! Went back over the newer changes since I've last reviewed and all seems in line to me.

Thanks as well for including the todo on what needs to happen when #958 is resolved.

edit: @gnarf I can't merge since there's a conflict to resolve so please feel free to do so after resolving that

@gnarf gnarf merged commit 83d204e into main Mar 18, 2024
2 checks passed
@gnarf gnarf deleted the enable-nvda-firefox branch March 18, 2024 19:10
@jugglinmike
Copy link
Contributor

This patch implements gh-914.

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

5 participants