An error occurred while loading ./plugins/poll/spec/integration/poll_endpoints_spec.rb.
Failure/Error: raise ArgumentError.new(“No setting named ‘#{name}’ exists”)
To run just the poll specs the command is: bundle exec rake "plugin:spec[poll]" (or shorter: bin/rake "plugin:spec[poll]") otherwise you’re running all plugins specs.
Regarding the error you’re getting, I’m not sure. Is the test database migrated? (bin/rails db:migrate RAILS_ENV=test)
Thanks. Like you said, it did run all the plugin specs, which I worked around by removing the other plugins. I was basing off of this, but it turns out the parentheses were in the wrong spot.
Yes, the database is migrated in the test environment. I worked around this error by commenting out the raise ArgumentError.new("No setting named '#{name}' exists") line and replacing it with a puts, and it shows only discourse_narrative_bot_enabled triggers this error; all other settings are fine. I don’t think we did anything with this setting. Anyway, since my spec run properly while ignoring this error, I can leave the workaround in my local discourse. When I find what actually caused this, I’ll update this post.
Nuestro CI funciona para PRs y commits, pero en el trabajo cron falla aquí cada vez.
Puedo reproducir esto en la consola de rails con un bloque similar:
[19] pry(main)> SiteSetting.defaults.tap do |s|
[19] pry(main)* s.set_regardless_of_locale(:discourse_narrative_bot_enab, false)
[19] pry(main)* end
ArgumentError: No setting named 'discourse_narrative_bot_enab' exists
Esto funciona si pongo:
[21] pry(main)> SiteSetting.defaults.tap do |s|
[21] pry(main)* if s.has_setting? :discourse_narrative_bot_enab
[21] pry(main)* s.set_regardless_of_locale(:discourse_narrative_bot_enab, false)
[21] pry(main)* end
[21] pry(main)* end
Y solo para comprobar, falla con:
[21] pry(main)> SiteSetting.defaults.tap do |s|
[21] pry(main)* if s.has_setting? :discourse_narrative_bot_enabled
[21] pry(main)* s.set_regardless_of_locale(:discourse_narrative_bot_enab, false)
[21] pry(main)* end
[21] pry(main)* end
Así que propongo el siguiente cambio en un PR que estaría feliz de enviar:
if ENV['LOAD_PLUGINS'] == '1' && s.has_setting? :discourse_narrative_bot_enabled
Por alguna razón, la presencia del plugin de bot narrativo no se puede garantizar?
En estos ejemplos, la configuración del sitio es discourse_narrative_bot_enab, no discourse_narrative_bot_enabled. Supongo que una vez que eso se corrija, ¿no se podrá reproducir?
Lo más sorprendente aquí es:
Eso sugiere una diferencia en el entorno de ejecución para las ejecuciones programadas
Mirando uno de los registros de fallos, parece que GitHub está clonando el plugin multilingüe directamente en el directorio plugins, en lugar de en su propio directorio. Por lo tanto, está esencialmente ‘desinstalando’ todos los plugins principales (y fallando en instalarse correctamente).
Mirando la documentación, no parece haber una forma consistente de obtener el nombre del repositorio (sin el propietario), por lo que necesitaremos algún truco. Creo que esto debería funcionar:
cc @cvx - ¿quizás deberíamos usar esta técnica en el CI de la plantilla de plugin/tema?