# Forwarding Server #gt1 - Running the full test suite

**URL:** <https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232>\
**Category:** Challenges\
**Tags:** challenge:dns-server\
**Created:** [January 16, 2025, 1:24pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232 "2025-01-16T13:24:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanbgd](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/ivanbgd/32/2379_2.png) [@ivanbgd](https://forum.codecrafters.io/u/ivanbgd)\
**Post date:** [January 16, 2025, 1:24pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232/1 "2025-01-16T13:24:48Z")

</div>

How is this last stage different in terms of running our code versus the previous stages?

In previous stages we didn’t have to pass any command line arguments to our program.

In this stage we have to, but then the previous stages are failing in the test runner.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 16, 2025, 1:35pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232/2 "2025-01-16T13:35:08Z")

</div>

Hi @ivanbgd, the last stage doesn’t differ significantly in terms of how your code is executed. All stages are tested using the `--resolver` flag. The difference is that earlier stages didn’t require you to handle it explicitly.

Suggestion: Focus on completing the last stage first. Once your code handles the `--resolver` flag properly, it should work seamlessly for all stages.

---

<div class="post-metadata">

**Author:** ![ivanbgd](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/ivanbgd/32/2379_2.png) [@ivanbgd](https://forum.codecrafters.io/u/ivanbgd)\
**Post date:** [January 16, 2025, 6:21pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232/3 "2025-01-16T18:21:23Z")

</div>

Hi @andy1li ,

Thank you for the reply.

I was trying to organize code in two different functions: one for standard mode and one for the forwarding mode. Would it make sense to do it that way? I tried to call the standard mode if we don’t receive a CLI argument, but then the previous tests fail, if you know what I mean.

Or does it make more sense if one function handles everything?

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 17, 2025, 1:54pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232/6 "2025-01-17T13:54:22Z")

</div>

I’d recommend using two separate functions for clarity. Let me know if you’d like me to take a look at your code for more specific feedback.

---

<div class="post-metadata">

**Author:** ![ivanbgd](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/ivanbgd/32/2379_2.png) [@ivanbgd](https://forum.codecrafters.io/u/ivanbgd)\
**Post date:** [January 18, 2025, 12:20pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232/11 "2025-01-18T12:20:00Z")

</div>

I didn’t split the function in two, but what solved the issue for me was to manually change `OpCode::InverseQuery` to `OpCode::Query`. There is one test case that sends `OpCode::InverseQuery` and it seems like resolver had issues with that.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [January 23, 2025, 12:20pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232/12 "2025-01-23T12:20:36Z")

</div>

Closed on January 23, 2025, 12:20pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
