Skip to content

[ENHANCEMENT] [MER-5487] scenario testing for authoring analytics - #6729

Merged
darrensiegel merged 6 commits into
masterfrom
MER-5487-author-analytics-testing
Jul 19, 2026
Merged

[ENHANCEMENT] [MER-5487] scenario testing for authoring analytics#6729
darrensiegel merged 6 commits into
masterfrom
MER-5487-author-analytics-testing

Conversation

@andersweinstein

@andersweinstein andersweinstein commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds scenario-based integration coverage for authoring analytics across realistic learner workflows and multiple course sections. Authoring analytics are those presented via Authoring Project Sidebar -> Improve -> Insights.

This introduces:

  • request_hint and reset_activity scenario directives for modeling hinted responses and repeated activity attempts.
  • A reusable assert.insights assertion that queries the same BrowseInsights application interface used by the authoring analytics UI.
  • Support for page, activity, and learning-objective analytics assertions.
  • Cross-section and section-specific aggregation coverage.
  • Documentation, schema validation, parser validation, and clear assertion failure messages.

The comprehensive scenario covers:

  • First-attempt correct.
  • First-attempt incorrect followed by a correct retry.
  • Incorrect response after requesting a hint.
  • Enrolled learner with no attempt.
  • Page, activity, and objective metrics.
  • num_correct, num_attempts, num_hints, num_first_attempts, num_first_attempts_correct, eventually_correct, first_attempt_correct, and relative_difficulty.

Snapshot generation is synchronous in the scenario test configuration, so no job-waiting or Oban queue-draining support was added.

Implementation Notes

  • Analytics assertions use Oli.Analytics.Summary.BrowseInsights.browse_insights/3 rather than duplicating analytics query logic.
  • Calculated metrics support configurable floating-point tolerance.
  • Assertions can verify that an analytics row does not exist with exists: false.
  • Scenario setup and execution use real application workflows through Oli.Scenarios.execute_file/2.
  • No fixtures, factories, mocks, arbitrary sleeps, or browser automation are used.

Verification

  • mix compile --warnings-as-errors
  • Complete scenario suite: 297 tests passed, 2 excluded.
  • Standalone cross-section analytics scenario: 8 assertions passed.
  • Focused learner-action and analytics assertion tests passed.
  • Scenario schema and parser validation passed.

@andersweinstein
andersweinstein force-pushed the MER-5487-author-analytics-testing branch from b8999cd to 262421c Compare July 15, 2026 17:05
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️ PR is large (2308 LOC changed). Consider splitting.

Risk score: 5 → risk/medium

Generated by 🚫 dangerJS against eba6d26

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

AI Review — performance

No issues found

@github-actions

Copy link
Copy Markdown
Contributor

AI Review — security

No issues found

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

AI Review — elixir

No issues found

@andersweinstein andersweinstein changed the title [ENHANCEMENT] [MER-5487] scenario testing for authoring analytics/insights [ENHANCEMENT] [MER-5487] scenario testing for authoring analytics Jul 15, 2026
@darrensiegel
darrensiegel merged commit 6a221d4 into master Jul 19, 2026
14 checks passed
@darrensiegel
darrensiegel deleted the MER-5487-author-analytics-testing branch July 19, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants