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

Display AT Version for finalized reports when TestPlanVersion is RECOMMENDED #1052

Merged
merged 35 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e563863
Add minimum or exact at version to reports
alflennik Apr 3, 2024
f233b0f
Quick tweak
alflennik Apr 3, 2024
5d7ef54
Revert home copy change
alflennik Apr 3, 2024
408b3f1
Remove unused field from createTestPlanReport
alflennik Apr 3, 2024
1d140c0
Fix undefined var
alflennik Apr 3, 2024
9695e4f
Prevent API from creating duplicate reports
alflennik Apr 3, 2024
64e08b2
Support primary test plan to be selected
howard-e Apr 4, 2024
9321c83
Fix test
howard-e Apr 4, 2024
66e6a12
Add resolver for finding firstRequiredAtVersion for a RECOMMENDED Tes…
howard-e Apr 9, 2024
a17112e
Add dialog when marking report as final for an admin to select from p…
howard-e Apr 9, 2024
c98e7b3
prioritised -> prioritized typo (british -> american english)
howard-e Apr 9, 2024
3b7e300
Merge branch 'refs/heads/primaryTestPlanRun' into trackFirstRequiredA…
howard-e Apr 9, 2024
48d889c
Update tests
howard-e Apr 9, 2024
d423d33
Track recommended AT version
howard-e Apr 9, 2024
b738bc0
Avoid displaying primary test plan run confirmation when just 1 run o…
howard-e Apr 10, 2024
b3d02b3
Merge branch 'refs/heads/development' into primaryTestPlanRun
howard-e Apr 10, 2024
1bd62ad
Merge branch 'refs/heads/primaryTestPlanRun' into trackFirstRequiredA…
howard-e Apr 10, 2024
7bcbd25
Merge branch 'refs/heads/trackFirstRequiredAtVersion' into trackRecom…
howard-e Apr 10, 2024
21a0c72
Fix graphql call when including "firstRequiredAtVersion" under "testP…
howard-e Apr 22, 2024
b916caf
Update description of firstRequiredAtVersion
howard-e Apr 22, 2024
f60af79
Add atVersion frontend
alflennik Apr 22, 2024
874dd55
Make sure automation dialog always shows when valid
alflennik Apr 22, 2024
54cc553
Rename resolver
howard-e Apr 22, 2024
099477f
Merge branch 'can-duplicate-test-plan-reports' into minimum-exact-at-…
alflennik Apr 22, 2024
ea97ee5
Make sure existing reports have a minimum at version
alflennik Apr 22, 2024
87aa47a
Formatting
howard-e Apr 22, 2024
3295713
Merge branch 'refs/heads/primaryTestPlanRun' into trackFirstRequiredA…
howard-e Apr 22, 2024
2a0e7d2
Merge branch 'refs/heads/trackFirstRequiredAtVersion' into trackRecom…
howard-e Apr 22, 2024
2efbe39
Fix graphql calls when doing testPlanReports > recommendedAtVersion
howard-e Apr 22, 2024
f1d2203
feat: Add resolver for tracking first required AT Version (#1051) Add…
howard-e Apr 24, 2024
1611f13
Merge branch 'refs/heads/minimum-exact-at-version' into primaryTestPl…
howard-e Apr 24, 2024
873d97b
Merge branch 'refs/heads/primaryTestPlanRun' into trackRecommendedAtV…
howard-e Apr 24, 2024
ab0571c
Use exactAtVersionId if available for recommendedAtVersion
howard-e Apr 25, 2024
8de6f58
Update comment
howard-e Apr 25, 2024
47bcd4b
Merge branch 'refs/heads/trends' into trackRecommendedAtVersion
howard-e May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions client/components/CandidateReview/TestPlans/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ const TestPlans = ({ testPlanVersions }) => {
to={`/candidate-test-plan/${testPlanVersion.id}/${atId}`}
>
{getTestPlanVersionTitle(
testPlanVersion
testPlanVersion,
{
includeVersionString: true
}
)}{' '}
{
testPlanVersion.versionString
}{' '}
({testsCount} Test
{testsCount === 0 ||
testsCount > 1
Expand Down Expand Up @@ -755,9 +755,9 @@ const TestPlans = ({ testPlanVersions }) => {
<tr key={testPlanVersion.id}>
<td>
{getTestPlanVersionTitle(
testPlanVersion
)}{' '}
{testPlanVersion.versionString}
testPlanVersion,
{ includeVersionString: true }
)}
</td>
<CenteredTd>
{jawsDataExists
Expand Down
5 changes: 3 additions & 2 deletions client/components/Reports/SummarizeTestPlanReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => {
);
if (!testPlanReport) return <Navigate to="/404" />;

const { at, browser } = testPlanReport;
const { at, browser, recommendedAtVersion } = testPlanReport;

// Construct testPlanTarget
const testPlanTarget = {
id: `${at.id}${browser.id}`,
at,
browser
browser,
atVersion: recommendedAtVersion
};

return (
Expand Down
5 changes: 3 additions & 2 deletions client/components/Reports/SummarizeTestPlanVersion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ const SummarizeTestPlanVersion = ({ testPlanVersion, testPlanReports }) => {
if (testPlanReport.status === 'DRAFT') return null;
const overallMetrics = getMetrics({ testPlanReport });

const { at, browser } = testPlanReport;
const { at, browser, recommendedAtVersion } = testPlanReport;

// Construct testPlanTarget
const testPlanTarget = {
id: `${at.id}${browser.id}`,
at,
browser
browser,
atVersion: recommendedAtVersion
};

return (
Expand Down
19 changes: 11 additions & 8 deletions client/components/Reports/getTitles.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const getTestPlanVersionTitle = testPlanVersion => {
return testPlanVersion.title || `"${testPlanVersion.testPlan.directory}"`;
const getTestPlanVersionTitle = (
testPlanVersion,
{ includeVersionString = false } = {}
) => {
let title = testPlanVersion.title || testPlanVersion.testPlan?.directory;
if (includeVersionString && testPlanVersion.versionString)
title = `${title} ${testPlanVersion.versionString}`;
return title;
};

// const getTestPlanTargetTitle = ({ browser, browserVersion, at, atVersion }) => {
// return `${at.name} ${atVersion} and ${browser.name} ${browserVersion}`;
// };

const getTestPlanTargetTitle = ({ browser, at }) => {
return `${at.name} and ${browser.name}`;
const getTestPlanTargetTitle = ({ at, browser, atVersion }) => {
if (!atVersion) return `${at.name} and ${browser.name}`;
return `${at.name} ${atVersion.name} and ${browser.name}`;
};

export { getTestPlanTargetTitle, getTestPlanVersionTitle };
4 changes: 4 additions & 0 deletions client/components/Reports/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export const REPORT_PAGE_QUERY = gql`
id
name
}
recommendedAtVersion {
id
name
}
runnableTests {
id
title
Expand Down
9 changes: 9 additions & 0 deletions server/graphql-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,15 @@ const graphqlSchema = gql`
Indicated by TestPlanReport.markedFinalAt existence, after a report has been "marked as final".
"""
isFinal: Boolean!
"""
The AtVersion to display for a TestPlanReport only when the
TestPlanVersion is RECOMMENDED.

If this TestPlanReport was created with an "exactAtVersionId" being set,
it will use the matching AtVersion, otherwise it will use the
TestPlanVersion.earliestAtVersion as a default.
"""
recommendedAtVersion: AtVersion
}

"""
Expand Down
8 changes: 8 additions & 0 deletions server/models/services/AtService.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ const removeAtVersionById = async ({ id, truncate = false, transaction }) => {
});
};

/**
* Returns all the unique AT Versions used when collecting results from testers
* for a Test Plan Report
* @param {number} testPlanReportId - id of the test plan report
* @param {object} options
* @param {*} options.transaction - Sequelize transaction
* @returns {Promise<*>}
*/
const getUniqueAtVersionsForReport = async (
testPlanReportId,
{ transaction }
Expand Down
2 changes: 2 additions & 0 deletions server/resolvers/TestPlanReport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const atVersions = require('./atVersionsResolver');
const at = require('./atResolver');
const browser = require('./browserResolver');
const latestAtVersionReleasedAt = require('./latestAtVersionReleasedAtResolver');
const recommendedAtVersion = require('./recommendedAtVersionResolver');
const isFinal = require('./isFinalResolver');
const exactAtVersion = require('./exactAtVersionResolver');
const minimumAtVersion = require('./minimumAtVersionResolver');
Expand All @@ -27,5 +28,6 @@ module.exports = {
minimumAtVersion,
browser,
latestAtVersionReleasedAt,
recommendedAtVersion,
isFinal
};
45 changes: 45 additions & 0 deletions server/resolvers/TestPlanReport/recommendedAtVersionResolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const { getAtVersionById } = require('../../models/services/AtService');
const {
getTestPlanVersionById
} = require('../../models/services/TestPlanVersionService');
const earliestAtVersionResolver = require('../TestPlanVersion/earliestAtVersionResolver');

const recommendedAtVersionResolver = async (testPlanReport, _, context) => {
const { transaction } = context;

let testPlanVersion;
if (testPlanReport.testPlanVersion) {
testPlanVersion = testPlanReport.testPlanVersion;
} else {
testPlanVersion = await getTestPlanVersionById({
id: testPlanReport.testPlanVersionId,
testPlanVersionAttributes: ['id', 'phase'],
testPlanReportAttributes: [],
testPlanRunAttributes: [],
atAttributes: [],
browserAttributes: [],
userAttributes: [],
transaction
});
}
const phase = testPlanVersion.phase;

if (!testPlanReport.markedFinalAt || phase !== 'RECOMMENDED') return null;

// If report was created with exact version being required, display that
if (testPlanReport.exactAtVersionId) {
return getAtVersionById({
id: testPlanReport.exactAtVersionId,
transaction
});
}

// Otherwise return the earliest At version used to record results
return earliestAtVersionResolver(
testPlanVersion,
{ atId: testPlanReport.atId },
context
);
};

module.exports = recommendedAtVersionResolver;
4 changes: 4 additions & 0 deletions server/resolvers/helpers/deriveAttributesFromCustomField.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ const deriveAttributesFromCustomField = (fieldName, customFields) => {
if (fields.includes('testPlanVersion'))
derived.push('testPlanVersionId');
if (fields.includes('isFinal')) derived.push('markedFinalAt');
if (fields.includes('recommendedAtVersion')) {
derived.push('testPlanVersionId');
derived.push('markedFinalAt');
}
break;
}
case 'draftTestPlanRuns': {
Expand Down
14 changes: 10 additions & 4 deletions server/tests/integration/graphql.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ describe('graphql', () => {
recommendedTestPlanVersion: testPlanVersion(id: 69) {
__typename
id
testPlanReports {
__typename
id
recommendedAtVersion {
__typename
id
name
releasedAt
}
}
earliestAtVersion(atId: 1) {
id
name
Expand Down Expand Up @@ -1006,7 +1016,3 @@ const getMutationInputs = async () => {
browserVersionId: browserVersion.id
};
};

/* Add the phrase to the assertion query. It will not work unless phrase is returned.
Find a test plan version that does have a phrase (V2).
*/
Loading