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

Exercise Palindrome Products - Automated tests time out (failing). #741

Closed
peerreynders opened this issue Sep 7, 2021 · 4 comments
Closed
Labels
x:action/fix Fix an issue x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/tiny Tiny amount of work

Comments

@peerreynders
Copy link
Contributor

Currently the automated tests are failing likely due to:

xtest('smallest palindrome from four digit factors', () => {
    const palindromes = generate({
      maxFactor: 9999,
      minFactor: 1000,
    })
    const smallest = palindromes.smallest
    const expected = { value: 1002001, factors: [[1001, 1001]] }

    expect(smallest.value).toEqual(expected.value)
    expect(sortFactors(smallest.factors)).toEqual(expected.factors)
  })

  test.skip('largest palindrome from four digit factors', () => {
    const palindromes = generate({
      maxFactor: 9999,
      minFactor: 1000,
    })
    const largest = palindromes.largest
    const expected = { value: 99000099, factors: [[9901, 9999]] }

    expect(largest.value).toEqual(expected.value)
    expect(sortFactors(largest.factors)).toEqual(expected.factors)
  })

I suspect that xtest is supposed to be test.skip as it can easily take 40 seconds to execute.

It may make sense to organize these tests in their own suite (or combine them into a single test to be skipped by default):

describe.skip('Palindromes from four digit factors', () => {
  test('smallest palindrome from four digit factors', () => {
    const palindromes = generate({
      maxFactor: 9999,
      minFactor: 1000,
    })
    const smallest = palindromes.smallest
    const expected = { value: 1002001, factors: [[1001, 1001]] }

    expect(smallest.value).toEqual(expected.value)
    expect(sortFactors(smallest.factors)).toEqual(expected.factors)
  })

  test('largest palindrome from four digit factors', () => {
    const palindromes = generate({
      maxFactor: 9999,
      minFactor: 1000,
    })
    const largest = palindromes.largest
    const expected = { value: 99000099, factors: [[9901, 9999]] }

    expect(largest.value).toEqual(expected.value)
    expect(sortFactors(largest.factors)).toEqual(expected.factors)
  })
})
@peerreynders peerreynders changed the title Exercise Palidrome Products - Automated tests time out (failing). Exercise Palindrome Products - Automated tests time out (failing). Sep 7, 2021
@SleeplessByte
Copy link
Member

Yesh. This makes sense. Want to make it a test.skip and get the rep?

@peerreynders
Copy link
Contributor Author

See PR #742

@SleeplessByte
Copy link
Member

closed by #742

@peerreynders
Copy link
Contributor Author

There still is a problem. The analysis considers skipped tests as failed tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/fix Fix an issue x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/tiny Tiny amount of work
Projects
None yet
Development

No branches or pull requests

2 participants