Skip to content

Commit

Permalink
Merge pull request #1238 from w3c/development
Browse files Browse the repository at this point in the history
Create October 10, 2024 Release

Includes the following changes:
* #1237, a follow-up for #1226
  • Loading branch information
howard-e authored Oct 10, 2024
2 parents 19074d1 + 84e0bd0 commit aa7159d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 9 deletions.
7 changes: 5 additions & 2 deletions client/components/BotRunTestStatusList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ const BotRunTestStatusList = ({ testPlanReportId }) => {
};
let anyPossibleUpdates = false;
if (testPlanRunsQueryResult?.testPlanRuns) {
for (const { collectionJob } of testPlanRunsQueryResult.testPlanRuns) {
if (collectionJob?.testStatus) {
for (const {
collectionJob,
tester
} of testPlanRunsQueryResult.testPlanRuns) {
if (collectionJob?.testStatus && tester?.isBot) {
for (const { status } of collectionJob.testStatus) {
counter[status]++;
if (status === 'QUEUED' || status === 'RUNNING') {
Expand Down
1 change: 1 addition & 0 deletions client/components/BotRunTestStatusList/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const TEST_PLAN_RUNS_TEST_RESULTS_QUERY = gql`
id
tester {
username
isBot
}
testResults {
id
Expand Down
58 changes: 52 additions & 6 deletions client/tests/BotRunTestStatusList.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('correctly displays statuses for single COMPLETED test run', async () => {
{
id: '0',
testResults: new Array(3).fill(null),
tester: { username: 'bot' },
tester: { username: 'bot', isBot: true },
collectionJob: {
status: COLLECTION_JOB_STATUS.COMPLETED,
testStatus: [
Expand Down Expand Up @@ -59,7 +59,7 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
{
id: '0',
testResults: new Array(2).fill(null),
tester: { username: 'bot' },
tester: { username: 'bot', isBot: true },
collectionJob: {
status: COLLECTION_JOB_STATUS.COMPLETED,
testStatus: [
Expand All @@ -71,7 +71,7 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
{
id: '1',
testResults: new Array(2).fill(null),
tester: { username: 'human' },
tester: { username: 'human', isBot: false },
collectionJob: null
}
];
Expand All @@ -90,12 +90,58 @@ test('correctly ignores test results from a human-submitted test plan run', asyn
});
});

// See gh-1237 - Check if user is a bot, to include in Bot Status calculation on Test Queue page
// https://github.com/w3c/aria-at-app/pull/1237
test('correctly ignores test results from a human-submitted test plan run with a collectionJob attribute', async () => {
const testPlanRuns = [
{
id: '0',
testResults: new Array(3).fill(null),
tester: { username: 'bot', isBot: true },
collectionJob: {
status: COLLECTION_JOB_STATUS.COMPLETED,
testStatus: [
{ status: COLLECTION_JOB_STATUS.COMPLETED },
{ status: COLLECTION_JOB_STATUS.COMPLETED },
{ status: COLLECTION_JOB_STATUS.COMPLETED }
]
}
},
{
id: '1',
testResults: new Array(3).fill(null),
tester: { username: 'human', isBot: false },
collectionJob: {
status: COLLECTION_JOB_STATUS.COMPLETED,
testStatus: [
{ status: COLLECTION_JOB_STATUS.COMPLETED },
{ status: COLLECTION_JOB_STATUS.COMPLETED },
{ status: COLLECTION_JOB_STATUS.COMPLETED }
]
}
}
];

const mocks = getMocks(testPlanRuns);

const { getByText } = render(
<MockedProvider mocks={mocks} addTypename={false}>
<BotRunTestStatusList testPlanReportId="1" />
</MockedProvider>
);

await waitFor(async () => {
expect(getByText('3 Tests Completed')).toBeInTheDocument();
expect(getByText('0 Tests Queued')).toBeInTheDocument();
});
});

test('correctly displays statuses for CANCELLED test run', async () => {
const testPlanRuns = [
{
id: '0',
testResults: new Array(2).fill(null),
tester: { username: 'bot' },
tester: { username: 'bot', isBot: true },
collectionJob: {
status: COLLECTION_JOB_STATUS.CANCELLED,
testStatus: [
Expand Down Expand Up @@ -127,7 +173,7 @@ test('correctly displays statuses for multiple RUNNING and QUEUED test runs', as
{
id: '0',
testResults: new Array(2).fill(null),
tester: { username: 'bot' },
tester: { username: 'bot', isBot: true },
collectionJob: {
status: COLLECTION_JOB_STATUS.RUNNING,
testStatus: [
Expand All @@ -140,7 +186,7 @@ test('correctly displays statuses for multiple RUNNING and QUEUED test runs', as
{
id: '1',
testResults: new Array(2).fill(null),
tester: { username: 'bot' },
tester: { username: 'bot', isBot: true },
collectionJob: {
status: COLLECTION_JOB_STATUS.CANCELLED,
testStatus: [
Expand Down
3 changes: 2 additions & 1 deletion testers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ stevefaulkner
stalgiag
gnarf
Paul-Clue
tactics2
tactics2
thinkbulecount2

0 comments on commit aa7159d

Please sign in to comment.