Skip to content

YTS test instructs how to download test data #58

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carloslima
Copy link
Contributor

In order to run the yaml test suite we need the data files to be present. A user with a fresh clone trying to run all tests will face an error. This makes the error message clear and provides the step needed to enable the tests to run.

@Copilot Copilot AI review requested due to automatic review settings July 11, 2025 16:27
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Ensures the YTS YAML test suite fails fast with a clear message when required data files are missing, and provides a Makefile target to fetch those data files.

  • Adds a pre-check in TestYAMLSuite that validates presence of test data and a failure message instructing how to download it.
  • Introduces a make test-data target in the GNUmakefile to manage fetching the required files.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
yts/test_suite_test.go Added a stat check for a sentinel subdirectory and a helpful fatal error guiding users to run make test-data.
GNUmakefile Added a test-data target that depends on $(YTS-DIR) for fetching test data.
Comments suppressed due to low confidence (1)

yts/test_suite_test.go:53

  • [nitpick] The error message has a minor grammar issue and could be clearer (e.g., "YTS tests require data files to be present at %s. Run 'make test-data' to download them.").
		t.Fatalf("YTS tests requires the data files to be present in `%s`. Run `make test-data` to download them.", testDir)

Comment on lines +52 to +53
if _, err := os.Stat(testDir + "/229Q"); os.IsNotExist(err) {
t.Fatalf("YTS tests requires the data files to be present in `%s`. Run `make test-data` to download them.", testDir)
Copy link
Preview

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using filepath.Join to construct the path instead of string concatenation and avoid hardcoding the 229Q subdirectory; checking the root testDir or a defined sentinel file may be more robust.

Suggested change
if _, err := os.Stat(testDir + "/229Q"); os.IsNotExist(err) {
t.Fatalf("YTS tests requires the data files to be present in `%s`. Run `make test-data` to download them.", testDir)
subDir := "229Q"
if _, err := os.Stat(filepath.Join(testDir, subDir)); os.IsNotExist(err) {
t.Fatalf("YTS tests require the data files to be present in `%s`. Run `make test-data` to download them.", testDir)

Copilot uses AI. Check for mistakes.

In order to run the yaml test suite we need the data files to be
present. A user with a fresh clone trying to run all tests will face an
error. This makes the error message clear and provides the step needed
to enable the tests to run.
@carloslima carloslima force-pushed the yts-data-download-instructions branch from 90a0557 to 318bbaf Compare July 11, 2025 16:51
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.

1 participant