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.
La nostra CI funziona per PR e commit, ma con il job cron fallisce qui ogni volta.
Sono in grado di riprodurre questo sulla console rails con un blocco simile:
[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
Questo funziona se metto:
[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
E solo per controllare, fallisce 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
Quindi propongo la seguente modifica in una PR che sarei felice di inviare:
if ENV['LOAD_PLUGINS'] == '1' && s.has_setting? :discourse_narrative_bot_enabled
Per qualche motivo la presenza del plugin narrative bot non può essere garantita?
In questi esempi, l’impostazione del sito è discourse_narrative_bot_enab, non discourse_narrative_bot_enabled. Suppongo che una volta corretta, non sia riproducibile?
La cosa più sorprendente qui è:
Ciò suggerisce una differenza nell’ambiente di runtime per le esecuzioni pianificate
Guardando uno dei log di errore, sembra che GitHub stia clonando il plugin multilingue direttamente nella directory plugins, anziché nella sua directory. Quindi, sta essenzialmente “disinstallando” tutti i plugin principali (e non riuscendo a installarsi correttamente).
Guardando la documentazione, non sembra esserci un modo coerente per ottenere il nome del repository (senza il proprietario), quindi avremo bisogno di qualche espediente. Penso che questo dovrebbe funzionare:
cc @cvx - forse dovremmo usare questa tecnica nel CI del modello di plugin/tema?