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

Create October 10, 2024 Release #1238

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading