Skip to content

Conversation

@charliemirabile
Copy link
Contributor

dummy assignments can be created using the new dummy option to configure initially all deadlines are set in the far future so that testing code can make submissions request oopsies etc without racing against the clock

when the relevant scenario has been staged, the trigger option can be passed to configure specifying an assignment and component name and the due date will be set to the current moment and the corresponding event will be run synchronously.

@theyoyojo
Copy link
Contributor

I'm going to rebase the new test PR onto this and make the changes

@theyoyojo
Copy link
Contributor

assuming it all works I'll approve, seems to work so far

Copy link
Contributor

@theyoyojo theyoyojo left a comment

Choose a reason for hiding this comment

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

no such assignment asdf
no such component 1
Traceback (most recent call last):
  File "/usr/local/share/denis/./configure.py", line 169, in <module>
    exit(main())
         ^^^^^^
  File "/usr/local/share/denis/./configure.py", line 77, in main
    subparser_func(**kwargs)
  File "/usr/local/share/denis/./configure.py", line 164, in trigger
    if err := sigqueue(1, signal.SIGRTMIN, asn.id * 3 + component_id):
                                           ^^^^^^
AttributeError: 'NoneType' object has no attribute 'id'
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a se -c 1
no such component 1
Traceback (most recent call last):
  File "/usr/local/share/denis/./configure.py", line 169, in <module>
    exit(main())
         ^^^^^^
  File "/usr/local/share/denis/./configure.py", line 77, in main
    subparser_func(**kwargs)
  File "/usr/local/share/denis/./configure.py", line 164, in trigger
    if err := sigqueue(1, signal.SIGRTMIN, asn.id * 3 + component_id):
                                                        ^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'component_id' where it is not associated with a value

when you run ./denis/configure.sh trigger -a $X -c $Y where $X doesn't refer to an extant assignment or $Y doesnt refer to on of the three valid options you get this error

…ered

dummy assignments can be created using the new `dummy` option to configure
initially all deadlines are set in the far future so that testing code can
make submissions request oopsies etc without racing against the clock

when the relevant scenario has been staged, the `trigger` option can be
passed to configure specifying an assignment and component name and the
due date will be set to the current moment and the corresponding event
will be run synchronously.
Right now configure.py always exits with code 0 because even though errors
are detected, we just print a message. Introduce an `errx` helper that
prints to stderr and exits the program and use throughout replacing the
existing calls to `print` in error cases.
@theyoyojo
Copy link
Contributor

I'll take a look later

@theyoyojo
Copy link
Contributor

bet lgtm:

joel@fedora:~/src/singularity$ ./denis/configure.sh dummy -a foo
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo
usage: configure trigger [-h] -a ASSIGNMENT -c COMPONENT
configure trigger: error: the following arguments are required: -c/--component
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -b xxx
usage: configure trigger [-h] -a ASSIGNMENT -c COMPONENT
configure trigger: error: the following arguments are required: -c/--component
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c xxx
no such component xxx
joel@fedora:~/src/singularity$ echo $?
1
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c initial
joel@fedora:~/src/singularity$ echo $?
0
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foobar -c initial
no such assignment foobar
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c initial
joel@fedora:~/src/singularity$ echo $?
0
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c peer
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c initial
joel@fedora:~/src/singularity$ echo $?
0
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c final
joel@fedora:~/src/singularity$ echo $?
0
joel@fedora:~/src/singularity$ ./denis/configure.sh trigger -a foo -c xxx
no such component xxx
joel@fedora:~/src/singularity$ echo $?
1

@theyoyojo theyoyojo merged commit aeffeff into master Sep 27, 2025
1 check passed
@theyoyojo theyoyojo deleted the denis_trigger branch September 27, 2025 01:16
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.

3 participants