Skip to content

test: remove AnomalyDetection dependency from time series tests (#36082)#1523

Open
hidekoji wants to merge 1 commit into
masterfrom
fix/issue-36082
Open

test: remove AnomalyDetection dependency from time series tests (#36082)#1523
hidekoji wants to merge 1 commit into
masterfrom
fix/issue-36082

Conversation

@hidekoji

@hidekoji hidekoji commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

AnomalyDetection (Twitter/GitHub-only package) was removed from bundled packages in milestone 15.5 (#36082). Tests that depended on data("raw_data", package = "AnomalyDetection") were silently skipping on Windows CI because the package is not installed.

Changes:

  • test_anomaly_detection.R: Delete tests 1-4 which call do_anomaly_detection() requiring the package. Keep tests 5-7 which use synthetic Date/POSIXct data and pass without the package.
  • test_arima_1.R: Replace data("raw_data", ...) in 6 tests with inline synthetic hourly POSIXct data (1400 rows starting 2014-01-01).
  • test_arima_2.R: Same replacement in 1 test; update intentional time-gap filter date to match new synthetic range.
  • test_prophet_1.R: Same replacement in 3 tests (aggregation, grouped case, without value_col).

Test plan

  • Verify Windows CI no longer shows skips for anomaly_detection, arima_1, arima_2, prophet_1 test files
  • Verify arima/prophet tests still exercise core functionality with the synthetic data

Paired tam PR: https://github.com/exploratory-io/tam/pull/36276

🤖 Generated with Claude Code

…ts (#36082)

AnomalyDetection (Twitter package) was removed from bundled packages in
milestone 15.5. Replace `data("raw_data", package = "AnomalyDetection")` with
inline synthetic hourly POSIXct data in all affected tests:

- test_anomaly_detection.R: delete tests 1-4 (require AnomalyDetection to run);
  keep tests 5-7 which already use synthetic data
- test_arima_1.R: replace in 6 tests
- test_arima_2.R: replace in 1 test; update intentional time-gap date to match
  new synthetic date range
- test_prophet_1.R: replace in 3 tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the AnomalyDetection package dependency from time-series tests so they no longer silently skip on Windows CI, while keeping core ARIMA/Prophet/anomaly-detection behaviors covered using inline synthetic fixtures.

Changes:

  • Removed do_anomaly_detection() tests that required AnomalyDetection::raw_data.
  • Replaced data("raw_data", package="AnomalyDetection") with inline synthetic POSIXct fixtures in ARIMA and Prophet tests.
  • Updated the intentional time-gap date in test_arima_2.R to align with the new synthetic data range.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/testthat/test_prophet_1.R Replaces AnomalyDetection::raw_data usage with an inline synthetic timestamp/count fixture in several Prophet tests.
tests/testthat/test_arima_2.R Replaces external dataset usage with a synthetic fixture and updates the intentional gap date to the new range.
tests/testthat/test_arima_1.R Replaces external dataset usage with a synthetic fixture across multiple ARIMA tests.
tests/testthat/test_anomaly_detection.R Deletes anomaly-detection tests that required the removed external package dataset, keeping synthetic Date/POSIXct coverage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +7
raw_data <- data.frame(
timestamp = seq(as.POSIXct("2014-01-01 00:00:00", tz="UTC"), by="1 hour", length.out=1400),
count = round(abs(rnorm(1400, mean=1000, sd=200)))
)
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.

2 participants