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

[Bug]: build fail when test file name contains capital letter #268

Open
xzdev opened this issue Aug 11, 2023 · 1 comment
Open

[Bug]: build fail when test file name contains capital letter #268

xzdev opened this issue Aug 11, 2023 · 1 comment
Labels
bug Something isn't working repro needed Repro needed to proceed further

Comments

@xzdev
Copy link

xzdev commented Aug 11, 2023

What happened?

The build fails when adding a test file with capital letter in the file name. E.g. I added a test file named Other.test.ts under next.js/apps/alpha/pages. The file just contain some dummy test case as below.

// Other.test.ts
import { render, screen } from '@testing-library/react';
import Home from './index';

describe('Other', () => {
    it('should fail', () => {
      expect(true).toBe(true);
    });
  });

When run the bazel build on specs, it runs into the following error.

➜  next.js git:(main) ✗ bazel build //apps/alpha/pages:specs    
INFO: Analyzed target //apps/alpha/pages:specs (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/xzdev/Sandbox/bazel-examples/next.js/apps/alpha/pages/BUILD.bazel:32:11: output 'apps/alpha/pages/Other.test.js' was not created
ERROR: /Users/xzdev/Sandbox/bazel-examples/next.js/apps/alpha/pages/BUILD.bazel:32:11: output 'apps/alpha/pages/Other.test.d.ts' was not created
ERROR: /Users/xzdev/Sandbox/bazel-examples/next.js/apps/alpha/pages/BUILD.bazel:32:11: Transpiling & type-checking TypeScript project @//apps/alpha/pages:specs [tsc -p tsconfig.json] failed: not all outputs were created or valid
Target //apps/alpha/pages:specs failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.112s, Critical Path: 1.14s
INFO: 2 processes: 1 internal, 1 worker.
FAILED: Build did NOT complete successfully

Version

Development (host) and target OS/architectures:

Output of bazel --version: aspect 5.3.4

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

http_archive(
    name = "aspect_rules_js",
    sha256 = "dcd1567d4a93a8634ec0b888b371a60b93c18d980f77dace02eb176531a71fcf",
    strip_prefix = "rules_js-1.26.0",
    url = "https://github.com/aspect-build/rules_js/releases/download/v1.26.0/rules_js-v1.26.0.tar.gz",
)

http_archive(
    name = "aspect_rules_ts",
    sha256 = "ace5b609603d9b5b875d56c9c07182357c4ee495030f40dcefb10d443ba8c208",
    strip_prefix = "rules_ts-1.4.0",
    url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.0/rules_ts-v1.4.0.tar.gz",
)

http_archive(
    name = "aspect_rules_jest",
    sha256 = "52dc08fd252add240124ef7ccc46df3a505121758dfb96578a3d5f2ebb4c2b40",
    strip_prefix = "rules_jest-0.18.1",
    url = "https://github.com/aspect-build/rules_jest/releases/download/v0.18.1/rules_jest-v0.18.1.tar.gz",
)

Language(s) and/or frameworks involved: TypeScript

How to reproduce

Add a dummy test file with capital letter. Make sure the file is also added to the BUILD file `specs` src. Run the bazel build on the specs and the error shows.

Any other information?

No response

@xzdev xzdev added the bug Something isn't working label Aug 11, 2023
@github-actions github-actions bot added the untriaged Requires traige label Aug 11, 2023
@xzdev xzdev changed the title [Bug]: build fail when test name contains capital letter [Bug]: build fail when test file name contains capital letter Aug 11, 2023
@alexeagle alexeagle added repro needed Repro needed to proceed further and removed untriaged Requires traige labels Sep 28, 2023
@alexeagle
Copy link
Member

Could you make a PR against https://github.com/bazelbuild/examples/tree/main/frontend (the next.js example has moved there) that reproduces your issue? That will make it much quicker for us to observe it and see if there's a bug in our example or one of these rulesets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro needed Repro needed to proceed further
Projects
Status: No status
Development

No branches or pull requests

2 participants