-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
Test start #2718
Closed
Closed
Test start #2718
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
;;;; SPDX-FileCopyrightText: Atlas Engineer LLC | ||
;;;; SPDX-License-Identifier: BSD-3-Clause | ||
|
||
(in-package :nyxt/tests) | ||
|
||
(define-class dummy-renderer (renderer) | ||
((name "Dummy renderer")) | ||
(:export-class-name-p t) | ||
(:export-accessor-names-p t) | ||
(:accessor-name-transformer (class*:make-name-transformer name))) | ||
|
||
(defmethod install ((_ dummy-renderer)) t) | ||
|
||
(defmethod uninstall ((_ dummy-renderer)) t) | ||
|
||
(setf nyxt::*renderer* (make-instance 'dummy-renderer)) | ||
|
||
(define-test null-quit () | ||
(assert-false (nyxt:quit))) | ||
|
||
;; See https://github.com/atlas-engineer/nyxt/issues/2754 | ||
;; (define-test start-quit-cycle () | ||
;; (assert-false (progn (nyxt:start :failsafe t) (nyxt:quit)))) | ||
|
||
;; Fails. | ||
(define-test stateless-headless-argument () | ||
(nyxt:start :headless t :failsafe t) | ||
(ffi-within-renderer-thread nyxt:*browser* | ||
(lambda () (assert-true nyxt::*headless-p*))) | ||
(nyxt:quit) | ||
|
||
(nyxt:start :failsafe t) | ||
(ffi-within-renderer-thread nyxt:*browser* | ||
(lambda () (assert-false nyxt::*headless-p*))) | ||
(nyxt:quit)) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ambrevar @aartaka @jmercouris
How critical do you think that this is?
For the user that starts Nyxt via the OS shell, it doesn't matter much.
For the developer that starts Nyxt from the REPL it's critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, fell under my radar.
It's not critical production-wise, as you pointed out.
Still, this highlights that our startup sequence is not as functional as we would hope, which indicates we wrote poor code :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
I'll soon come back to this PR by adding all tests that would capture the invariants of a good startup sequence. If some are not met, then I'll leave them commented out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pierre covered it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean @jmercouris?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I agree with Pierre's conclusions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!